Skip to content

Commit

Permalink
Merge pull request #222 from HubSpot/revert-221-feature/codegenCrmPro…
Browse files Browse the repository at this point in the history
…perties

Revert "Regeneration crm properties(codegen only)"
  • Loading branch information
ksvirkou-hubspot authored Mar 2, 2023
2 parents 6d80568 + 7505ffe commit 7c701be
Show file tree
Hide file tree
Showing 14 changed files with 940 additions and 915 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\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\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\BatchResponsePropertyWithErrors|\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\BatchResponseProperty|\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\BatchResponsePropertyWithErrors' === '\SplFileObject') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors' !== 'string') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', []),
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty', []),
$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\BatchResponsePropertyWithErrors',
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
$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\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\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\BatchResponsePropertyWithErrors|\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\BatchResponseProperty|\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\BatchResponsePropertyWithErrors' === '\SplFileObject') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
$content = (string) $response->getBody();
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors' !== 'string') {
if ('\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty' !== 'string') {
$content = json_decode($content);
}
}

return [
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors', []),
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty', []),
$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\BatchResponsePropertyWithErrors',
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
Expand Down
80 changes: 26 additions & 54 deletions codegen/Crm/Properties/Api/CoreApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,15 +713,14 @@ 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\CollectionResponsePropertyNoPaging|\HubSpot\Client\Crm\Properties\Model\Error
* @return \HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error
*/
public function getAll($object_type, $archived = false, $properties = null)
public function getAll($object_type, $archived = false)
{
list($response) = $this->getAllWithHttpInfo($object_type, $archived, $properties);
list($response) = $this->getAllWithHttpInfo($object_type, $archived);
return $response;
}

Expand All @@ -732,15 +731,14 @@ public function getAll($object_type, $archived = false, $properties = null)
*
* @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\CollectionResponsePropertyNoPaging|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
* @return array of \HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getAllWithHttpInfo($object_type, $archived = false, $properties = null)
public function getAllWithHttpInfo($object_type, $archived = false)
{
$request = $this->getAllRequest($object_type, $archived, $properties);
$request = $this->getAllRequest($object_type, $archived);

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

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

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

$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging';
$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
Expand All @@ -831,7 +829,7 @@ public function getAllWithHttpInfo($object_type, $archived = false, $properties
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging',
'\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
Expand All @@ -856,14 +854,13 @@ public function getAllWithHttpInfo($object_type, $archived = false, $properties
*
* @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, $properties = null)
public function getAllAsync($object_type, $archived = false)
{
return $this->getAllAsyncWithHttpInfo($object_type, $archived, $properties)
return $this->getAllAsyncWithHttpInfo($object_type, $archived)
->then(
function ($response) {
return $response[0];
Expand All @@ -878,15 +875,14 @@ 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, $properties = null)
public function getAllAsyncWithHttpInfo($object_type, $archived = false)
{
$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponsePropertyNoPaging';
$request = $this->getAllRequest($object_type, $archived, $properties);
$returnType = '\HubSpot\Client\Crm\Properties\Model\CollectionResponseProperty';
$request = $this->getAllRequest($object_type, $archived);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -929,12 +925,11 @@ 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, $properties = null)
public function getAllRequest($object_type, $archived = false)
{
// verify the required parameter 'object_type' is set
if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {
Expand All @@ -959,15 +954,6 @@ public function getAllRequest($object_type, $archived = false, $properties = nul
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 @@ -1054,15 +1040,14 @@ public function getAllRequest($object_type, $archived = false, $properties = nul
* @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, $properties = null)
public function getByName($object_type, $property_name, $archived = false)
{
list($response) = $this->getByNameWithHttpInfo($object_type, $property_name, $archived, $properties);
list($response) = $this->getByNameWithHttpInfo($object_type, $property_name, $archived);
return $response;
}

Expand All @@ -1074,15 +1059,14 @@ public function getByName($object_type, $property_name, $archived = false, $prop
* @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, $properties = null)
public function getByNameWithHttpInfo($object_type, $property_name, $archived = false)
{
$request = $this->getByNameRequest($object_type, $property_name, $archived, $properties);
$request = $this->getByNameRequest($object_type, $property_name, $archived);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -1199,14 +1183,13 @@ 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, $properties = null)
public function getByNameAsync($object_type, $property_name, $archived = false)
{
return $this->getByNameAsyncWithHttpInfo($object_type, $property_name, $archived, $properties)
return $this->getByNameAsyncWithHttpInfo($object_type, $property_name, $archived)
->then(
function ($response) {
return $response[0];
Expand All @@ -1222,15 +1205,14 @@ 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, $properties = null)
public function getByNameAsyncWithHttpInfo($object_type, $property_name, $archived = false)
{
$returnType = '\HubSpot\Client\Crm\Properties\Model\Property';
$request = $this->getByNameRequest($object_type, $property_name, $archived, $properties);
$request = $this->getByNameRequest($object_type, $property_name, $archived);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -1274,12 +1256,11 @@ 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, $properties = null)
public function getByNameRequest($object_type, $property_name, $archived = false)
{
// verify the required parameter 'object_type' is set
if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {
Expand Down Expand Up @@ -1310,15 +1291,6 @@ 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 7c701be

Please sign in to comment.