Skip to content

Commit

Permalink
Merge pull request #223 from HubSpot/feature/codegen
Browse files Browse the repository at this point in the history
Regenerate crm properties (Codegen only)
  • Loading branch information
ksvirkou-hubspot authored Mar 2, 2023
2 parents 7c701be + fa9d2ee commit 3e3838c
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 15 deletions.
40 changes: 35 additions & 5 deletions codegen/Crm/Properties/Model/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable
'hubspot_defined' => 'bool',
'show_currency_symbol' => 'bool',
'modification_metadata' => '\HubSpot\Client\Crm\Properties\Model\PropertyModificationMetadata',
'form_field' => 'bool'
'form_field' => 'bool',
'calculation_formula' => 'string'
];

/**
Expand Down Expand Up @@ -112,7 +113,8 @@ class Property implements ModelInterface, ArrayAccess, \JsonSerializable
'hubspot_defined' => null,
'show_currency_symbol' => null,
'modification_metadata' => null,
'form_field' => null
'form_field' => null,
'calculation_formula' => null
];

/**
Expand Down Expand Up @@ -164,7 +166,8 @@ public static function openAPIFormats()
'hubspot_defined' => 'hubspotDefined',
'show_currency_symbol' => 'showCurrencySymbol',
'modification_metadata' => 'modificationMetadata',
'form_field' => 'formField'
'form_field' => 'formField',
'calculation_formula' => 'calculationFormula'
];

/**
Expand Down Expand Up @@ -195,7 +198,8 @@ public static function openAPIFormats()
'hubspot_defined' => 'setHubspotDefined',
'show_currency_symbol' => 'setShowCurrencySymbol',
'modification_metadata' => 'setModificationMetadata',
'form_field' => 'setFormField'
'form_field' => 'setFormField',
'calculation_formula' => 'setCalculationFormula'
];

/**
Expand Down Expand Up @@ -226,7 +230,8 @@ public static function openAPIFormats()
'hubspot_defined' => 'getHubspotDefined',
'show_currency_symbol' => 'getShowCurrencySymbol',
'modification_metadata' => 'getModificationMetadata',
'form_field' => 'getFormField'
'form_field' => 'getFormField',
'calculation_formula' => 'getCalculationFormula'
];

/**
Expand Down Expand Up @@ -309,6 +314,7 @@ public function __construct(array $data = null)
$this->container['show_currency_symbol'] = $data['show_currency_symbol'] ?? null;
$this->container['modification_metadata'] = $data['modification_metadata'] ?? null;
$this->container['form_field'] = $data['form_field'] ?? null;
$this->container['calculation_formula'] = $data['calculation_formula'] ?? null;
}

/**
Expand Down Expand Up @@ -907,6 +913,30 @@ public function setFormField($form_field)

return $this;
}

/**
* Gets calculation_formula
*
* @return string|null
*/
public function getCalculationFormula()
{
return $this->container['calculation_formula'];
}

/**
* Sets calculation_formula
*
* @param string|null $calculation_formula Represents a formula that is used to compute a calculated property.
*
* @return self
*/
public function setCalculationFormula($calculation_formula)
{
$this->container['calculation_formula'] = $calculation_formula;

return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
Expand Down
104 changes: 99 additions & 5 deletions codegen/Crm/Properties/Model/PropertyCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable
'display_order' => 'int',
'has_unique_value' => 'bool',
'hidden' => 'bool',
'form_field' => 'bool'
'form_field' => 'bool',
'external_options' => 'bool',
'referenced_object_type' => 'string',
'calculation_formula' => 'string'
];

/**
Expand All @@ -88,7 +91,10 @@ class PropertyCreate implements ModelInterface, ArrayAccess, \JsonSerializable
'display_order' => 'int32',
'has_unique_value' => null,
'hidden' => null,
'form_field' => null
'form_field' => null,
'external_options' => null,
'referenced_object_type' => null,
'calculation_formula' => null
];

/**
Expand Down Expand Up @@ -128,7 +134,10 @@ public static function openAPIFormats()
'display_order' => 'displayOrder',
'has_unique_value' => 'hasUniqueValue',
'hidden' => 'hidden',
'form_field' => 'formField'
'form_field' => 'formField',
'external_options' => 'externalOptions',
'referenced_object_type' => 'referencedObjectType',
'calculation_formula' => 'calculationFormula'
];

/**
Expand All @@ -147,7 +156,10 @@ public static function openAPIFormats()
'display_order' => 'setDisplayOrder',
'has_unique_value' => 'setHasUniqueValue',
'hidden' => 'setHidden',
'form_field' => 'setFormField'
'form_field' => 'setFormField',
'external_options' => 'setExternalOptions',
'referenced_object_type' => 'setReferencedObjectType',
'calculation_formula' => 'setCalculationFormula'
];

/**
Expand All @@ -166,7 +178,10 @@ public static function openAPIFormats()
'display_order' => 'getDisplayOrder',
'has_unique_value' => 'getHasUniqueValue',
'hidden' => 'getHidden',
'form_field' => 'getFormField'
'form_field' => 'getFormField',
'external_options' => 'getExternalOptions',
'referenced_object_type' => 'getReferencedObjectType',
'calculation_formula' => 'getCalculationFormula'
];

/**
Expand Down Expand Up @@ -215,6 +230,7 @@ public function getModelName()
public const TYPE_DATE = 'date';
public const TYPE_DATETIME = 'datetime';
public const TYPE_ENUMERATION = 'enumeration';
public const TYPE_BOOL = 'bool';
public const FIELD_TYPE_TEXTAREA = 'textarea';
public const FIELD_TYPE_TEXT = 'text';
public const FIELD_TYPE_DATE = 'date';
Expand All @@ -224,6 +240,7 @@ public function getModelName()
public const FIELD_TYPE_RADIO = 'radio';
public const FIELD_TYPE_CHECKBOX = 'checkbox';
public const FIELD_TYPE_BOOLEANCHECKBOX = 'booleancheckbox';
public const FIELD_TYPE_CALCULATION_EQUATION = 'calculation_equation';

/**
* Gets allowable values of the enum
Expand All @@ -238,6 +255,7 @@ public function getTypeAllowableValues()
self::TYPE_DATE,
self::TYPE_DATETIME,
self::TYPE_ENUMERATION,
self::TYPE_BOOL,
];
}

Expand All @@ -258,6 +276,7 @@ public function getFieldTypeAllowableValues()
self::FIELD_TYPE_RADIO,
self::FIELD_TYPE_CHECKBOX,
self::FIELD_TYPE_BOOLEANCHECKBOX,
self::FIELD_TYPE_CALCULATION_EQUATION,
];
}

Expand Down Expand Up @@ -287,6 +306,9 @@ public function __construct(array $data = null)
$this->container['has_unique_value'] = $data['has_unique_value'] ?? null;
$this->container['hidden'] = $data['hidden'] ?? null;
$this->container['form_field'] = $data['form_field'] ?? null;
$this->container['external_options'] = $data['external_options'] ?? null;
$this->container['referenced_object_type'] = $data['referenced_object_type'] ?? null;
$this->container['calculation_formula'] = $data['calculation_formula'] ?? null;
}

/**
Expand Down Expand Up @@ -629,6 +651,78 @@ public function setFormField($form_field)

return $this;
}

/**
* Gets external_options
*
* @return bool|null
*/
public function getExternalOptions()
{
return $this->container['external_options'];
}

/**
* Sets external_options
*
* @param bool|null $external_options Applicable only for 'enumeration' type properties. Should be set to true in conjunction with a 'referencedObjectType' of 'OWNER'. Otherwise false.
*
* @return self
*/
public function setExternalOptions($external_options)
{
$this->container['external_options'] = $external_options;

return $this;
}

/**
* Gets referenced_object_type
*
* @return string|null
*/
public function getReferencedObjectType()
{
return $this->container['referenced_object_type'];
}

/**
* Sets referenced_object_type
*
* @param string|null $referenced_object_type Should be set to 'OWNER' when 'externalOptions' is true, which causes the property to dynamically pull option values from the current HubSpot users.
*
* @return self
*/
public function setReferencedObjectType($referenced_object_type)
{
$this->container['referenced_object_type'] = $referenced_object_type;

return $this;
}

/**
* Gets calculation_formula
*
* @return string|null
*/
public function getCalculationFormula()
{
return $this->container['calculation_formula'];
}

/**
* Sets calculation_formula
*
* @param string|null $calculation_formula Represents a formula that is used to compute a calculated property.
*
* @return self
*/
public function setCalculationFormula($calculation_formula)
{
$this->container['calculation_formula'] = $calculation_formula;

return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
Expand Down
44 changes: 39 additions & 5 deletions codegen/Crm/Properties/Model/PropertyUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable
'options' => '\HubSpot\Client\Crm\Properties\Model\OptionInput[]',
'display_order' => 'int',
'hidden' => 'bool',
'form_field' => 'bool'
'form_field' => 'bool',
'calculation_formula' => 'string'
];

/**
Expand All @@ -84,7 +85,8 @@ class PropertyUpdate implements ModelInterface, ArrayAccess, \JsonSerializable
'options' => null,
'display_order' => 'int32',
'hidden' => null,
'form_field' => null
'form_field' => null,
'calculation_formula' => null
];

/**
Expand Down Expand Up @@ -122,7 +124,8 @@ public static function openAPIFormats()
'options' => 'options',
'display_order' => 'displayOrder',
'hidden' => 'hidden',
'form_field' => 'formField'
'form_field' => 'formField',
'calculation_formula' => 'calculationFormula'
];

/**
Expand All @@ -139,7 +142,8 @@ public static function openAPIFormats()
'options' => 'setOptions',
'display_order' => 'setDisplayOrder',
'hidden' => 'setHidden',
'form_field' => 'setFormField'
'form_field' => 'setFormField',
'calculation_formula' => 'setCalculationFormula'
];

/**
Expand All @@ -156,7 +160,8 @@ public static function openAPIFormats()
'options' => 'getOptions',
'display_order' => 'getDisplayOrder',
'hidden' => 'getHidden',
'form_field' => 'getFormField'
'form_field' => 'getFormField',
'calculation_formula' => 'getCalculationFormula'
];

/**
Expand Down Expand Up @@ -205,6 +210,7 @@ public function getModelName()
public const TYPE_DATE = 'date';
public const TYPE_DATETIME = 'datetime';
public const TYPE_ENUMERATION = 'enumeration';
public const TYPE_BOOL = 'bool';
public const FIELD_TYPE_TEXTAREA = 'textarea';
public const FIELD_TYPE_TEXT = 'text';
public const FIELD_TYPE_DATE = 'date';
Expand All @@ -214,6 +220,7 @@ public function getModelName()
public const FIELD_TYPE_RADIO = 'radio';
public const FIELD_TYPE_CHECKBOX = 'checkbox';
public const FIELD_TYPE_BOOLEANCHECKBOX = 'booleancheckbox';
public const FIELD_TYPE_CALCULATION_EQUATION = 'calculation_equation';

/**
* Gets allowable values of the enum
Expand All @@ -228,6 +235,7 @@ public function getTypeAllowableValues()
self::TYPE_DATE,
self::TYPE_DATETIME,
self::TYPE_ENUMERATION,
self::TYPE_BOOL,
];
}

Expand All @@ -248,6 +256,7 @@ public function getFieldTypeAllowableValues()
self::FIELD_TYPE_RADIO,
self::FIELD_TYPE_CHECKBOX,
self::FIELD_TYPE_BOOLEANCHECKBOX,
self::FIELD_TYPE_CALCULATION_EQUATION,
];
}

Expand Down Expand Up @@ -275,6 +284,7 @@ public function __construct(array $data = null)
$this->container['display_order'] = $data['display_order'] ?? null;
$this->container['hidden'] = $data['hidden'] ?? null;
$this->container['form_field'] = $data['form_field'] ?? null;
$this->container['calculation_formula'] = $data['calculation_formula'] ?? null;
}

/**
Expand Down Expand Up @@ -554,6 +564,30 @@ public function setFormField($form_field)

return $this;
}

/**
* Gets calculation_formula
*
* @return string|null
*/
public function getCalculationFormula()
{
return $this->container['calculation_formula'];
}

/**
* Sets calculation_formula
*
* @param string|null $calculation_formula Represents a formula that is used to compute a calculated property.
*
* @return self
*/
public function setCalculationFormula($calculation_formula)
{
$this->container['calculation_formula'] = $calculation_formula;

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

0 comments on commit 3e3838c

Please sign in to comment.