Skip to content

Commit 1a0df6c

Browse files
Merge pull request #474 from HubSpot/feature/codegenCrmObjects
Codegen: CRM Objects clients
2 parents 03b5848 + 4eec677 commit 1a0df6c

176 files changed

Lines changed: 3794 additions & 1545 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codegen/Crm/Objects/Api/BasicApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
/**
13-
* Objects
13+
* CRM Objects
1414
*
1515
* CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
1616
*

codegen/Crm/Objects/Api/BatchApi.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
/**
13-
* Objects
13+
* CRM Objects
1414
*
1515
* CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
1616
*
@@ -400,16 +400,16 @@ public function archiveRequest($object_type, $batch_input_simple_public_object_i
400400
* Create a batch of objects
401401
*
402402
* @param string $object_type object_type (required)
403-
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectInputForCreate $batch_input_simple_public_object_input_for_create batch_input_simple_public_object_input_for_create (required)
403+
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create batch_input_simple_public_object_batch_input_for_create (required)
404404
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
405405
*
406406
* @throws \HubSpot\Client\Crm\Objects\ApiException on non-2xx response or if the response body is not in the expected format
407407
* @throws \InvalidArgumentException
408408
* @return \HubSpot\Client\Crm\Objects\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Model\Error
409409
*/
410-
public function create($object_type, $batch_input_simple_public_object_input_for_create, string $contentType = self::contentTypes['create'][0])
410+
public function create($object_type, $batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0])
411411
{
412-
list($response) = $this->createWithHttpInfo($object_type, $batch_input_simple_public_object_input_for_create, $contentType);
412+
list($response) = $this->createWithHttpInfo($object_type, $batch_input_simple_public_object_batch_input_for_create, $contentType);
413413
return $response;
414414
}
415415

@@ -419,16 +419,16 @@ public function create($object_type, $batch_input_simple_public_object_input_for
419419
* Create a batch of objects
420420
*
421421
* @param string $object_type (required)
422-
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectInputForCreate $batch_input_simple_public_object_input_for_create (required)
422+
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required)
423423
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
424424
*
425425
* @throws \HubSpot\Client\Crm\Objects\ApiException on non-2xx response or if the response body is not in the expected format
426426
* @throws \InvalidArgumentException
427427
* @return array of \HubSpot\Client\Crm\Objects\Model\BatchResponseSimplePublicObject|\HubSpot\Client\Crm\Objects\Model\BatchResponseSimplePublicObjectWithErrors|\HubSpot\Client\Crm\Objects\Model\Error, HTTP status code, HTTP response headers (array of strings)
428428
*/
429-
public function createWithHttpInfo($object_type, $batch_input_simple_public_object_input_for_create, string $contentType = self::contentTypes['create'][0])
429+
public function createWithHttpInfo($object_type, $batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0])
430430
{
431-
$request = $this->createRequest($object_type, $batch_input_simple_public_object_input_for_create, $contentType);
431+
$request = $this->createRequest($object_type, $batch_input_simple_public_object_batch_input_for_create, $contentType);
432432

433433
try {
434434
$options = $this->createHttpClientOption();
@@ -614,15 +614,15 @@ public function createWithHttpInfo($object_type, $batch_input_simple_public_obje
614614
* Create a batch of objects
615615
*
616616
* @param string $object_type (required)
617-
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectInputForCreate $batch_input_simple_public_object_input_for_create (required)
617+
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required)
618618
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
619619
*
620620
* @throws \InvalidArgumentException
621621
* @return \GuzzleHttp\Promise\PromiseInterface
622622
*/
623-
public function createAsync($object_type, $batch_input_simple_public_object_input_for_create, string $contentType = self::contentTypes['create'][0])
623+
public function createAsync($object_type, $batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0])
624624
{
625-
return $this->createAsyncWithHttpInfo($object_type, $batch_input_simple_public_object_input_for_create, $contentType)
625+
return $this->createAsyncWithHttpInfo($object_type, $batch_input_simple_public_object_batch_input_for_create, $contentType)
626626
->then(
627627
function ($response) {
628628
return $response[0];
@@ -636,16 +636,16 @@ function ($response) {
636636
* Create a batch of objects
637637
*
638638
* @param string $object_type (required)
639-
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectInputForCreate $batch_input_simple_public_object_input_for_create (required)
639+
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required)
640640
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
641641
*
642642
* @throws \InvalidArgumentException
643643
* @return \GuzzleHttp\Promise\PromiseInterface
644644
*/
645-
public function createAsyncWithHttpInfo($object_type, $batch_input_simple_public_object_input_for_create, string $contentType = self::contentTypes['create'][0])
645+
public function createAsyncWithHttpInfo($object_type, $batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0])
646646
{
647647
$returnType = '\HubSpot\Client\Crm\Objects\Model\BatchResponseSimplePublicObject';
648-
$request = $this->createRequest($object_type, $batch_input_simple_public_object_input_for_create, $contentType);
648+
$request = $this->createRequest($object_type, $batch_input_simple_public_object_batch_input_for_create, $contentType);
649649

650650
return $this->client
651651
->sendAsync($request, $this->createHttpClientOption())
@@ -687,13 +687,13 @@ function ($exception) {
687687
* Create request for operation 'create'
688688
*
689689
* @param string $object_type (required)
690-
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectInputForCreate $batch_input_simple_public_object_input_for_create (required)
690+
* @param \HubSpot\Client\Crm\Objects\Model\BatchInputSimplePublicObjectBatchInputForCreate $batch_input_simple_public_object_batch_input_for_create (required)
691691
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
692692
*
693693
* @throws \InvalidArgumentException
694694
* @return \GuzzleHttp\Psr7\Request
695695
*/
696-
public function createRequest($object_type, $batch_input_simple_public_object_input_for_create, string $contentType = self::contentTypes['create'][0])
696+
public function createRequest($object_type, $batch_input_simple_public_object_batch_input_for_create, string $contentType = self::contentTypes['create'][0])
697697
{
698698

699699
// verify the required parameter 'object_type' is set
@@ -703,10 +703,10 @@ public function createRequest($object_type, $batch_input_simple_public_object_in
703703
);
704704
}
705705

706-
// verify the required parameter 'batch_input_simple_public_object_input_for_create' is set
707-
if ($batch_input_simple_public_object_input_for_create === null || (is_array($batch_input_simple_public_object_input_for_create) && count($batch_input_simple_public_object_input_for_create) === 0)) {
706+
// verify the required parameter 'batch_input_simple_public_object_batch_input_for_create' is set
707+
if ($batch_input_simple_public_object_batch_input_for_create === null || (is_array($batch_input_simple_public_object_batch_input_for_create) && count($batch_input_simple_public_object_batch_input_for_create) === 0)) {
708708
throw new \InvalidArgumentException(
709-
'Missing the required parameter $batch_input_simple_public_object_input_for_create when calling create'
709+
'Missing the required parameter $batch_input_simple_public_object_batch_input_for_create when calling create'
710710
);
711711
}
712712

@@ -737,12 +737,12 @@ public function createRequest($object_type, $batch_input_simple_public_object_in
737737
);
738738

739739
// for model (json/xml)
740-
if (isset($batch_input_simple_public_object_input_for_create)) {
740+
if (isset($batch_input_simple_public_object_batch_input_for_create)) {
741741
if (stripos($headers['Content-Type'], 'application/json') !== false) {
742742
# if Content-Type contains "application/json", json_encode the body
743-
$httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($batch_input_simple_public_object_input_for_create));
743+
$httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($batch_input_simple_public_object_batch_input_for_create));
744744
} else {
745-
$httpBody = $batch_input_simple_public_object_input_for_create;
745+
$httpBody = $batch_input_simple_public_object_batch_input_for_create;
746746
}
747747
} elseif (count($formParams) > 0) {
748748
if ($multipart) {

codegen/Crm/Objects/Api/SearchApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
/**
13-
* Objects
13+
* CRM Objects
1414
*
1515
* CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
1616
*

codegen/Crm/Objects/ApiException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
/**
13-
* Objects
13+
* CRM Objects
1414
*
1515
* CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
1616
*

0 commit comments

Comments
 (0)