Skip to content

Commit 534dd1d

Browse files
Merge pull request #612 from HubSpot/codegen/crmProreties
Codegen: CRM Properties
2 parents 6f6a488 + 9c5a6d7 commit 534dd1d

14 files changed

Lines changed: 1177 additions & 122 deletions

codegen/Crm/Properties/Api/BatchApi.php

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public function archiveRequest($object_type, $batch_input_property_name, string
391391
*
392392
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
393393
* @throws \InvalidArgumentException
394-
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error
394+
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error
395395
*/
396396
public function create($object_type, $batch_input_property_create, string $contentType = self::contentTypes['create'][0])
397397
{
@@ -410,7 +410,7 @@ public function create($object_type, $batch_input_property_create, string $conte
410410
*
411411
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
412412
* @throws \InvalidArgumentException
413-
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
413+
* @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)
414414
*/
415415
public function createWithHttpInfo($object_type, $batch_input_property_create, string $contentType = self::contentTypes['create'][0])
416416
{
@@ -440,12 +440,18 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s
440440

441441

442442
switch($statusCode) {
443-
case 200:
443+
case 201:
444444
return $this->handleResponseWithDataType(
445445
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
446446
$request,
447447
$response,
448448
);
449+
case 207:
450+
return $this->handleResponseWithDataType(
451+
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
452+
$request,
453+
$response,
454+
);
449455
default:
450456
return $this->handleResponseWithDataType(
451457
'\HubSpot\Client\Crm\Properties\Model\Error',
@@ -476,14 +482,22 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s
476482
);
477483
} catch (ApiException $e) {
478484
switch ($e->getCode()) {
479-
case 200:
485+
case 201:
480486
$data = ObjectSerializer::deserialize(
481487
$e->getResponseBody(),
482488
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
483489
$e->getResponseHeaders()
484490
);
485491
$e->setResponseObject($data);
486492
throw $e;
493+
case 207:
494+
$data = ObjectSerializer::deserialize(
495+
$e->getResponseBody(),
496+
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
497+
$e->getResponseHeaders()
498+
);
499+
$e->setResponseObject($data);
500+
throw $e;
487501
default:
488502
$data = ObjectSerializer::deserialize(
489503
$e->getResponseBody(),
@@ -697,7 +711,7 @@ public function createRequest($object_type, $batch_input_property_create, string
697711
*
698712
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
699713
* @throws \InvalidArgumentException
700-
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error
714+
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error
701715
*/
702716
public function read($object_type, $batch_read_input_property_name, $locale = null, string $contentType = self::contentTypes['read'][0])
703717
{
@@ -717,7 +731,7 @@ public function read($object_type, $batch_read_input_property_name, $locale = nu
717731
*
718732
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
719733
* @throws \InvalidArgumentException
720-
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
734+
* @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)
721735
*/
722736
public function readWithHttpInfo($object_type, $batch_read_input_property_name, $locale = null, string $contentType = self::contentTypes['read'][0])
723737
{
@@ -753,6 +767,12 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name,
753767
$request,
754768
$response,
755769
);
770+
case 207:
771+
return $this->handleResponseWithDataType(
772+
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
773+
$request,
774+
$response,
775+
);
756776
default:
757777
return $this->handleResponseWithDataType(
758778
'\HubSpot\Client\Crm\Properties\Model\Error',
@@ -791,6 +811,14 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name,
791811
);
792812
$e->setResponseObject($data);
793813
throw $e;
814+
case 207:
815+
$data = ObjectSerializer::deserialize(
816+
$e->getResponseBody(),
817+
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
818+
$e->getResponseHeaders()
819+
);
820+
$e->setResponseObject($data);
821+
throw $e;
794822
default:
795823
$data = ObjectSerializer::deserialize(
796824
$e->getResponseBody(),

codegen/Crm/Properties/Api/GroupsApi.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function archiveWithHttpInfo($object_type, $group_name, string $contentTy
207207
$e->setResponseObject($data);
208208
throw $e;
209209
}
210-
210+
211211

212212
throw $e;
213213
}
@@ -461,7 +461,7 @@ public function createWithHttpInfo($object_type, $property_group_create, string
461461
);
462462
}
463463

464-
464+
465465

466466
if ($statusCode < 200 || $statusCode > 299) {
467467
throw new ApiException(
@@ -500,7 +500,7 @@ public function createWithHttpInfo($object_type, $property_group_create, string
500500
$e->setResponseObject($data);
501501
throw $e;
502502
}
503-
503+
504504

505505
throw $e;
506506
}
@@ -766,7 +766,7 @@ public function getAllWithHttpInfo($object_type, $locale = null, string $content
766766
);
767767
}
768768

769-
769+
770770

771771
if ($statusCode < 200 || $statusCode > 299) {
772772
throw new ApiException(
@@ -805,7 +805,7 @@ public function getAllWithHttpInfo($object_type, $locale = null, string $content
805805
$e->setResponseObject($data);
806806
throw $e;
807807
}
808-
808+
809809

810810
throw $e;
811811
}
@@ -1069,7 +1069,7 @@ public function getByNameWithHttpInfo($object_type, $group_name, $locale = null,
10691069
);
10701070
}
10711071

1072-
1072+
10731073

10741074
if ($statusCode < 200 || $statusCode > 299) {
10751075
throw new ApiException(
@@ -1108,7 +1108,7 @@ public function getByNameWithHttpInfo($object_type, $group_name, $locale = null,
11081108
$e->setResponseObject($data);
11091109
throw $e;
11101110
}
1111-
1111+
11121112

11131113
throw $e;
11141114
}
@@ -1390,7 +1390,7 @@ public function updateWithHttpInfo($object_type, $group_name, $property_group_up
13901390
);
13911391
}
13921392

1393-
1393+
13941394

13951395
if ($statusCode < 200 || $statusCode > 299) {
13961396
throw new ApiException(
@@ -1429,7 +1429,7 @@ public function updateWithHttpInfo($object_type, $group_name, $property_group_up
14291429
$e->setResponseObject($data);
14301430
throw $e;
14311431
}
1432-
1432+
14331433

14341434
throw $e;
14351435
}

codegen/Crm/Properties/Model/BatchReadInputPropertyName.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public function getArchived()
351351
/**
352352
* Sets archived
353353
*
354-
* @param bool $archived archived
354+
* @param bool $archived Specifies whether the property is archived.
355355
*
356356
* @return self
357357
*/
@@ -378,7 +378,7 @@ public function getDataSensitivity()
378378
/**
379379
* Sets data_sensitivity
380380
*
381-
* @param string $data_sensitivity data_sensitivity
381+
* @param string $data_sensitivity Indicates the sensitivity level of the data, such as 'non_sensitive', 'sensitive', or 'highly_sensitive'.
382382
*
383383
* @return self
384384
*/

codegen/Crm/Properties/Model/BatchResponseProperty.php

Lines changed: 5 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali
5858
*/
5959
protected static $openAPITypes = [
6060
'completed_at' => '\DateTime',
61-
'errors' => '\HubSpot\Client\Crm\Properties\Model\StandardError[]',
6261
'links' => 'array<string,string>',
63-
'num_errors' => 'int',
6462
'requested_at' => '\DateTime',
6563
'results' => '\HubSpot\Client\Crm\Properties\Model\Property[]',
6664
'started_at' => '\DateTime',
@@ -76,9 +74,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali
7674
*/
7775
protected static $openAPIFormats = [
7876
'completed_at' => 'date-time',
79-
'errors' => null,
8077
'links' => null,
81-
'num_errors' => 'int32',
8278
'requested_at' => 'date-time',
8379
'results' => null,
8480
'started_at' => 'date-time',
@@ -92,9 +88,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali
9288
*/
9389
protected static array $openAPINullables = [
9490
'completed_at' => false,
95-
'errors' => false,
9691
'links' => false,
97-
'num_errors' => false,
9892
'requested_at' => false,
9993
'results' => false,
10094
'started_at' => false,
@@ -188,9 +182,7 @@ public function isNullableSetToNull(string $property): bool
188182
*/
189183
protected static $attributeMap = [
190184
'completed_at' => 'completedAt',
191-
'errors' => 'errors',
192185
'links' => 'links',
193-
'num_errors' => 'numErrors',
194186
'requested_at' => 'requestedAt',
195187
'results' => 'results',
196188
'started_at' => 'startedAt',
@@ -204,9 +196,7 @@ public function isNullableSetToNull(string $property): bool
204196
*/
205197
protected static $setters = [
206198
'completed_at' => 'setCompletedAt',
207-
'errors' => 'setErrors',
208199
'links' => 'setLinks',
209-
'num_errors' => 'setNumErrors',
210200
'requested_at' => 'setRequestedAt',
211201
'results' => 'setResults',
212202
'started_at' => 'setStartedAt',
@@ -220,9 +210,7 @@ public function isNullableSetToNull(string $property): bool
220210
*/
221211
protected static $getters = [
222212
'completed_at' => 'getCompletedAt',
223-
'errors' => 'getErrors',
224213
'links' => 'getLinks',
225-
'num_errors' => 'getNumErrors',
226214
'requested_at' => 'getRequestedAt',
227215
'results' => 'getResults',
228216
'started_at' => 'getStartedAt',
@@ -306,9 +294,7 @@ public function getStatusAllowableValues()
306294
public function __construct(?array $data = null)
307295
{
308296
$this->setIfExists('completed_at', $data ?? [], null);
309-
$this->setIfExists('errors', $data ?? [], null);
310297
$this->setIfExists('links', $data ?? [], null);
311-
$this->setIfExists('num_errors', $data ?? [], null);
312298
$this->setIfExists('requested_at', $data ?? [], null);
313299
$this->setIfExists('results', $data ?? [], null);
314300
$this->setIfExists('started_at', $data ?? [], null);
@@ -391,7 +377,7 @@ public function getCompletedAt()
391377
/**
392378
* Sets completed_at
393379
*
394-
* @param \DateTime $completed_at completed_at
380+
* @param \DateTime $completed_at The timestamp indicating when the batch operation was completed.
395381
*
396382
* @return self
397383
*/
@@ -405,33 +391,6 @@ public function setCompletedAt($completed_at)
405391
return $this;
406392
}
407393

408-
/**
409-
* Gets errors
410-
*
411-
* @return \HubSpot\Client\Crm\Properties\Model\StandardError[]|null
412-
*/
413-
public function getErrors()
414-
{
415-
return $this->container['errors'];
416-
}
417-
418-
/**
419-
* Sets errors
420-
*
421-
* @param \HubSpot\Client\Crm\Properties\Model\StandardError[]|null $errors errors
422-
*
423-
* @return self
424-
*/
425-
public function setErrors($errors)
426-
{
427-
if (is_null($errors)) {
428-
throw new \InvalidArgumentException('non-nullable errors cannot be null');
429-
}
430-
$this->container['errors'] = $errors;
431-
432-
return $this;
433-
}
434-
435394
/**
436395
* Gets links
437396
*
@@ -445,7 +404,7 @@ public function getLinks()
445404
/**
446405
* Sets links
447406
*
448-
* @param array<string,string>|null $links links
407+
* @param array<string,string>|null $links A collection of URLs linking to documentation or resources related to the batch operation.
449408
*
450409
* @return self
451410
*/
@@ -459,33 +418,6 @@ public function setLinks($links)
459418
return $this;
460419
}
461420

462-
/**
463-
* Gets num_errors
464-
*
465-
* @return int|null
466-
*/
467-
public function getNumErrors()
468-
{
469-
return $this->container['num_errors'];
470-
}
471-
472-
/**
473-
* Sets num_errors
474-
*
475-
* @param int|null $num_errors num_errors
476-
*
477-
* @return self
478-
*/
479-
public function setNumErrors($num_errors)
480-
{
481-
if (is_null($num_errors)) {
482-
throw new \InvalidArgumentException('non-nullable num_errors cannot be null');
483-
}
484-
$this->container['num_errors'] = $num_errors;
485-
486-
return $this;
487-
}
488-
489421
/**
490422
* Gets requested_at
491423
*
@@ -499,7 +431,7 @@ public function getRequestedAt()
499431
/**
500432
* Sets requested_at
501433
*
502-
* @param \DateTime|null $requested_at requested_at
434+
* @param \DateTime|null $requested_at The timestamp indicating when the batch operation was requested.
503435
*
504436
* @return self
505437
*/
@@ -553,7 +485,7 @@ public function getStartedAt()
553485
/**
554486
* Sets started_at
555487
*
556-
* @param \DateTime $started_at started_at
488+
* @param \DateTime $started_at The timestamp indicating when the batch operation began processing.
557489
*
558490
* @return self
559491
*/
@@ -580,7 +512,7 @@ public function getStatus()
580512
/**
581513
* Sets status
582514
*
583-
* @param string $status status
515+
* @param string $status The current status of the batch operation, with possible values being CANCELED, COMPLETE, PENDING, or PROCESSING.
584516
*
585517
* @return self
586518
*/

0 commit comments

Comments
 (0)