Skip to content

Commit

Permalink
Merge pull request #221 from HubSpot/feature/codegenCrmProperties
Browse files Browse the repository at this point in the history
Regeneration crm properties(codegen only)
  • Loading branch information
ksvirkou-hubspot authored Mar 2, 2023
2 parents 9cd97ad + bd68422 commit 6d80568
Show file tree
Hide file tree
Showing 14 changed files with 915 additions and 940 deletions.
24 changes: 12 additions & 12 deletions codegen/Crm/Properties/Api/BatchApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public function archiveRequest($object_type, $batch_input_property_name)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\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)
{
Expand All @@ -403,7 +403,7 @@ public function create($object_type, $batch_input_property_create)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\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)
{
Expand Down Expand Up @@ -461,17 +461,17 @@ public function createWithHttpInfo($object_type, $batch_input_property_create)
$response->getHeaders()
];
case 207:
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' === '\SplFileObject') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' !== 'string') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors' !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty', []),
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', []),
$response->getStatusCode(),
$response->getHeaders()
];
Expand Down Expand Up @@ -521,7 +521,7 @@ public function createWithHttpInfo($object_type, $batch_input_property_create)
case 207:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
Expand Down Expand Up @@ -737,7 +737,7 @@ public function createRequest($object_type, $batch_input_property_create)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\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)
{
Expand All @@ -755,7 +755,7 @@ public function read($object_type, $batch_read_input_property_name)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\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)
{
Expand Down Expand Up @@ -813,17 +813,17 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name)
$response->getHeaders()
];
case 207:
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' === '\SplFileObject') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' !== 'string') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors' !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty', []),
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', []),
$response->getStatusCode(),
$response->getHeaders()
];
Expand Down Expand Up @@ -873,7 +873,7 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name)
case 207:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
Expand Down
80 changes: 54 additions & 26 deletions codegen/Crm/Properties/Api/CoreApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,15 @@ public function createRequest($object_type, $property_create)
*
* @param string $object_type object_type (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties properties (optional)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error
* @return \HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging|\HubSpot\Client\Crm\Properties\Model\Error
*/
public function getAll($object_type, $archived = false)
public function getAll($object_type, $archived = false, $properties = null)
{
list($response) = $this->getAllWithHttpInfo($object_type, $archived);
list($response) = $this->getAllWithHttpInfo($object_type, $archived, $properties);
return $response;
}

Expand All @@ -731,14 +732,15 @@ public function getAll($object_type, $archived = false)
*
* @param string $object_type (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
* @return array of \HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getAllWithHttpInfo($object_type, $archived = false)
public function getAllWithHttpInfo($object_type, $archived = false, $properties = null)
{
$request = $this->getAllRequest($object_type, $archived);
$request = $this->getAllRequest($object_type, $archived, $properties);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -777,17 +779,17 @@ public function getAllWithHttpInfo($object_type, $archived = false)

switch($statusCode) {
case 200:
if ('\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty' === '\SplFileObject') {
if ('\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty' !== 'string') {
if ('\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging' !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty', []),
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging', []),
$response->getStatusCode(),
$response->getHeaders()
];
Expand All @@ -808,7 +810,7 @@ public function getAllWithHttpInfo($object_type, $archived = false)
];
}

$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty';
$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
Expand All @@ -829,7 +831,7 @@ public function getAllWithHttpInfo($object_type, $archived = false)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty',
'\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
Expand All @@ -854,13 +856,14 @@ public function getAllWithHttpInfo($object_type, $archived = false)
*
* @param string $object_type (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getAllAsync($object_type, $archived = false)
public function getAllAsync($object_type, $archived = false, $properties = null)
{
return $this->getAllAsyncWithHttpInfo($object_type, $archived)
return $this->getAllAsyncWithHttpInfo($object_type, $archived, $properties)
->then(
function ($response) {
return $response[0];
Expand All @@ -875,14 +878,15 @@ function ($response) {
*
* @param string $object_type (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getAllAsyncWithHttpInfo($object_type, $archived = false)
public function getAllAsyncWithHttpInfo($object_type, $archived = false, $properties = null)
{
$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty';
$request = $this->getAllRequest($object_type, $archived);
$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging';
$request = $this->getAllRequest($object_type, $archived, $properties);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -925,11 +929,12 @@ function ($exception) {
*
* @param string $object_type (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function getAllRequest($object_type, $archived = false)
public function getAllRequest($object_type, $archived = false, $properties = null)
{
// verify the required parameter 'object_type' is set
if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {
Expand All @@ -954,6 +959,15 @@ public function getAllRequest($object_type, $archived = false)
true, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$properties,
'properties', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? []);


// path params
Expand Down Expand Up @@ -1040,14 +1054,15 @@ public function getAllRequest($object_type, $archived = false)
* @param string $object_type object_type (required)
* @param string $property_name property_name (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties properties (optional)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Properties\Model\Property|\HubSpot\Client\Crm\Properties\Model\Error
*/
public function getByName($object_type, $property_name, $archived = false)
public function getByName($object_type, $property_name, $archived = false, $properties = null)
{
list($response) = $this->getByNameWithHttpInfo($object_type, $property_name, $archived);
list($response) = $this->getByNameWithHttpInfo($object_type, $property_name, $archived, $properties);
return $response;
}

Expand All @@ -1059,14 +1074,15 @@ public function getByName($object_type, $property_name, $archived = false)
* @param string $object_type (required)
* @param string $property_name (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Properties\Model\Property|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getByNameWithHttpInfo($object_type, $property_name, $archived = false)
public function getByNameWithHttpInfo($object_type, $property_name, $archived = false, $properties = null)
{
$request = $this->getByNameRequest($object_type, $property_name, $archived);
$request = $this->getByNameRequest($object_type, $property_name, $archived, $properties);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -1183,13 +1199,14 @@ public function getByNameWithHttpInfo($object_type, $property_name, $archived =
* @param string $object_type (required)
* @param string $property_name (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getByNameAsync($object_type, $property_name, $archived = false)
public function getByNameAsync($object_type, $property_name, $archived = false, $properties = null)
{
return $this->getByNameAsyncWithHttpInfo($object_type, $property_name, $archived)
return $this->getByNameAsyncWithHttpInfo($object_type, $property_name, $archived, $properties)
->then(
function ($response) {
return $response[0];
Expand All @@ -1205,14 +1222,15 @@ function ($response) {
* @param string $object_type (required)
* @param string $property_name (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getByNameAsyncWithHttpInfo($object_type, $property_name, $archived = false)
public function getByNameAsyncWithHttpInfo($object_type, $property_name, $archived = false, $properties = null)
{
$returnType = '\HubSpot\Client\Crm\Properties\Model\Property';
$request = $this->getByNameRequest($object_type, $property_name, $archived);
$request = $this->getByNameRequest($object_type, $property_name, $archived, $properties);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -1256,11 +1274,12 @@ function ($exception) {
* @param string $object_type (required)
* @param string $property_name (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $properties (optional)
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function getByNameRequest($object_type, $property_name, $archived = false)
public function getByNameRequest($object_type, $property_name, $archived = false, $properties = null)
{
// verify the required parameter 'object_type' is set
if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {
Expand Down Expand Up @@ -1291,6 +1310,15 @@ public function getByNameRequest($object_type, $property_name, $archived = false
true, // explode
false // required
) ?? []);
// query params
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
$properties,
'properties', // param base name
'string', // openApiType
'form', // style
true, // explode
false // required
) ?? []);


// path params
Expand Down
Loading

0 comments on commit 6d80568

Please sign in to comment.