Skip to content

Commit

Permalink
Merge pull request #205 from HubSpot/feature/codegen
Browse files Browse the repository at this point in the history
CRM associations and marketing events(Codegen only)
  • Loading branch information
ksvirkou-hubspot authored Jan 12, 2023
2 parents ea08afc + 76ed80c commit 8cf38e5
Show file tree
Hide file tree
Showing 13 changed files with 1,907 additions and 344 deletions.
102 changes: 60 additions & 42 deletions codegen/Crm/Associations/Api/BatchApi.php

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions codegen/Crm/Associations/Api/TypesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function getConfig()
*
* @throws \HubSpot\Client\Crm\Associations\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefiniton|\HubSpot\Client\Crm\Associations\Model\Error
* @return \HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefinitionNoPaging|\HubSpot\Client\Crm\Associations\Model\Error
*/
public function getAll($from_object_type, $to_object_type)
{
Expand All @@ -143,7 +143,7 @@ public function getAll($from_object_type, $to_object_type)
*
* @throws \HubSpot\Client\Crm\Associations\ApiException on non-2xx response
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefiniton|\HubSpot\Client\Crm\Associations\Model\Error, HTTP status code, HTTP response headers (array of strings)
* @return array of \HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefinitionNoPaging|\HubSpot\Client\Crm\Associations\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function getAllWithHttpInfo($from_object_type, $to_object_type)
{
Expand Down Expand Up @@ -186,17 +186,17 @@ public function getAllWithHttpInfo($from_object_type, $to_object_type)

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

return [
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefiniton', []),
ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefinitionNoPaging', []),
$response->getStatusCode(),
$response->getHeaders()
];
Expand All @@ -217,7 +217,7 @@ public function getAllWithHttpInfo($from_object_type, $to_object_type)
];
}

$returnType = '\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefiniton';
$returnType = '\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefinitionNoPaging';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
} else {
Expand All @@ -238,7 +238,7 @@ public function getAllWithHttpInfo($from_object_type, $to_object_type)
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefiniton',
'\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefinitionNoPaging',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
Expand Down Expand Up @@ -290,7 +290,7 @@ function ($response) {
*/
public function getAllAsyncWithHttpInfo($from_object_type, $to_object_type)
{
$returnType = '\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefiniton';
$returnType = '\HubSpot\Client\Crm\Associations\Model\CollectionResponsePublicAssociationDefinitionNoPaging';
$request = $this->getAllRequest($from_object_type, $to_object_type);

return $this->client
Expand Down
166 changes: 68 additions & 98 deletions codegen/Crm/Associations/Model/BatchResponsePublicAssociation.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ class BatchResponsePublicAssociation implements ModelInterface, ArrayAccess, \Js
* @var string[]
*/
protected static $openAPITypes = [
'results' => '\HubSpot\Client\Crm\Associations\Model\PublicAssociation[]',
'num_errors' => 'int',
'errors' => '\HubSpot\Client\Crm\Associations\Model\StandardError[]',
'status' => 'string',
'results' => '\HubSpot\Client\Crm\Associations\Model\PublicAssociation[]',
'requested_at' => '\DateTime',
'started_at' => '\DateTime',
'completed_at' => '\DateTime'
'completed_at' => '\DateTime',
'links' => 'array<string,string>'
];

/**
Expand All @@ -74,13 +73,12 @@ class BatchResponsePublicAssociation implements ModelInterface, ArrayAccess, \Js
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'results' => null,
'num_errors' => 'int32',
'errors' => null,
'status' => null,
'results' => null,
'requested_at' => 'date-time',
'started_at' => 'date-time',
'completed_at' => 'date-time'
'completed_at' => 'date-time',
'links' => null
];

/**
Expand Down Expand Up @@ -110,13 +108,12 @@ public static function openAPIFormats()
* @var string[]
*/
protected static $attributeMap = [
'results' => 'results',
'num_errors' => 'numErrors',
'errors' => 'errors',
'status' => 'status',
'results' => 'results',
'requested_at' => 'requestedAt',
'started_at' => 'startedAt',
'completed_at' => 'completedAt'
'completed_at' => 'completedAt',
'links' => 'links'
];

/**
Expand All @@ -125,13 +122,12 @@ public static function openAPIFormats()
* @var string[]
*/
protected static $setters = [
'results' => 'setResults',
'num_errors' => 'setNumErrors',
'errors' => 'setErrors',
'status' => 'setStatus',
'results' => 'setResults',
'requested_at' => 'setRequestedAt',
'started_at' => 'setStartedAt',
'completed_at' => 'setCompletedAt'
'completed_at' => 'setCompletedAt',
'links' => 'setLinks'
];

/**
Expand All @@ -140,13 +136,12 @@ public static function openAPIFormats()
* @var string[]
*/
protected static $getters = [
'results' => 'getResults',
'num_errors' => 'getNumErrors',
'errors' => 'getErrors',
'status' => 'getStatus',
'results' => 'getResults',
'requested_at' => 'getRequestedAt',
'started_at' => 'getStartedAt',
'completed_at' => 'getCompletedAt'
'completed_at' => 'getCompletedAt',
'links' => 'getLinks'
];

/**
Expand Down Expand Up @@ -225,13 +220,12 @@ public function getStatusAllowableValues()
*/
public function __construct(array $data = null)
{
$this->container['results'] = $data['results'] ?? null;
$this->container['num_errors'] = $data['num_errors'] ?? null;
$this->container['errors'] = $data['errors'] ?? null;
$this->container['status'] = $data['status'] ?? null;
$this->container['results'] = $data['results'] ?? null;
$this->container['requested_at'] = $data['requested_at'] ?? null;
$this->container['started_at'] = $data['started_at'] ?? null;
$this->container['completed_at'] = $data['completed_at'] ?? null;
$this->container['links'] = $data['links'] ?? null;
}

/**
Expand All @@ -243,9 +237,6 @@ public function listInvalidProperties()
{
$invalidProperties = [];

if ($this->container['results'] === null) {
$invalidProperties[] = "'results' can't be null";
}
if ($this->container['status'] === null) {
$invalidProperties[] = "'status' can't be null";
}
Expand All @@ -258,6 +249,9 @@ public function listInvalidProperties()
);
}

if ($this->container['results'] === null) {
$invalidProperties[] = "'results' can't be null";
}
if ($this->container['started_at'] === null) {
$invalidProperties[] = "'started_at' can't be null";
}
Expand All @@ -279,78 +273,6 @@ public function valid()
}


/**
* Gets results
*
* @return \HubSpot\Client\Crm\Associations\Model\PublicAssociation[]
*/
public function getResults()
{
return $this->container['results'];
}

/**
* Sets results
*
* @param \HubSpot\Client\Crm\Associations\Model\PublicAssociation[] $results results
*
* @return self
*/
public function setResults($results)
{
$this->container['results'] = $results;

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)
{
$this->container['num_errors'] = $num_errors;

return $this;
}

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

/**
* Sets errors
*
* @param \HubSpot\Client\Crm\Associations\Model\StandardError[]|null $errors errors
*
* @return self
*/
public function setErrors($errors)
{
$this->container['errors'] = $errors;

return $this;
}

/**
* Gets status
*
Expand Down Expand Up @@ -385,6 +307,30 @@ public function setStatus($status)
return $this;
}

/**
* Gets results
*
* @return \HubSpot\Client\Crm\Associations\Model\PublicAssociation[]
*/
public function getResults()
{
return $this->container['results'];
}

/**
* Sets results
*
* @param \HubSpot\Client\Crm\Associations\Model\PublicAssociation[] $results results
*
* @return self
*/
public function setResults($results)
{
$this->container['results'] = $results;

return $this;
}

/**
* Gets requested_at
*
Expand Down Expand Up @@ -456,6 +402,30 @@ public function setCompletedAt($completed_at)

return $this;
}

/**
* Gets links
*
* @return array<string,string>|null
*/
public function getLinks()
{
return $this->container['links'];
}

/**
* Sets links
*
* @param array<string,string>|null $links links
*
* @return self
*/
public function setLinks($links)
{
$this->container['links'] = $links;

return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
Expand Down
Loading

0 comments on commit 8cf38e5

Please sign in to comment.