Skip to content

Commit afbd1e3

Browse files
Merge pull request #219 from HubSpot/feature/codegen
Regenerate crm properties (Codegen only)
2 parents 09f9174 + 1bb1400 commit afbd1e3

File tree

3 files changed

+70
-20
lines changed

3 files changed

+70
-20
lines changed

lib/hubspot/codegen/crm/properties/models/property.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class Property
8383
# Whether or not the property can be used in a HubSpot form.
8484
attr_accessor :form_field
8585

86+
# Represents a formula that is used to compute a calculated property.
87+
attr_accessor :calculation_formula
88+
8689
# Attribute mapping from ruby-style variable name to JSON key.
8790
def self.attribute_map
8891
{
@@ -108,7 +111,8 @@ def self.attribute_map
108111
:'hubspot_defined' => :'hubspotDefined',
109112
:'show_currency_symbol' => :'showCurrencySymbol',
110113
:'modification_metadata' => :'modificationMetadata',
111-
:'form_field' => :'formField'
114+
:'form_field' => :'formField',
115+
:'calculation_formula' => :'calculationFormula'
112116
}
113117
end
114118

@@ -142,7 +146,8 @@ def self.openapi_types
142146
:'hubspot_defined' => :'Boolean',
143147
:'show_currency_symbol' => :'Boolean',
144148
:'modification_metadata' => :'PropertyModificationMetadata',
145-
:'form_field' => :'Boolean'
149+
:'form_field' => :'Boolean',
150+
:'calculation_formula' => :'String'
146151
}
147152
end
148153

@@ -260,6 +265,10 @@ def initialize(attributes = {})
260265
if attributes.key?(:'form_field')
261266
self.form_field = attributes[:'form_field']
262267
end
268+
269+
if attributes.key?(:'calculation_formula')
270+
self.calculation_formula = attributes[:'calculation_formula']
271+
end
263272
end
264273

265274
# Show invalid properties with the reasons. Usually used together with valid?
@@ -337,7 +346,8 @@ def ==(o)
337346
hubspot_defined == o.hubspot_defined &&
338347
show_currency_symbol == o.show_currency_symbol &&
339348
modification_metadata == o.modification_metadata &&
340-
form_field == o.form_field
349+
form_field == o.form_field &&
350+
calculation_formula == o.calculation_formula
341351
end
342352

343353
# @see the `==` method
@@ -349,7 +359,7 @@ def eql?(o)
349359
# Calculates hash code according to all attributes.
350360
# @return [Integer] Hash code
351361
def hash
352-
[updated_at, created_at, archived_at, name, label, type, field_type, description, group_name, options, created_user_id, updated_user_id, referenced_object_type, display_order, calculated, external_options, archived, has_unique_value, hidden, hubspot_defined, show_currency_symbol, modification_metadata, form_field].hash
362+
[updated_at, created_at, archived_at, name, label, type, field_type, description, group_name, options, created_user_id, updated_user_id, referenced_object_type, display_order, calculated, external_options, archived, has_unique_value, hidden, hubspot_defined, show_currency_symbol, modification_metadata, form_field, calculation_formula].hash
353363
end
354364

355365
# Builds the object from hash

lib/hubspot/codegen/crm/properties/models/property_create.rb

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ class PropertyCreate
5050
# Whether or not the property can be used in a HubSpot form.
5151
attr_accessor :form_field
5252

53+
# Applicable only for 'enumeration' type properties. Should be set to true in conjunction with a 'referencedObjectType' of 'OWNER'. Otherwise false.
54+
attr_accessor :external_options
55+
56+
# Should be set to 'OWNER' when 'externalOptions' is true, which causes the property to dynamically pull option values from the current HubSpot users.
57+
attr_accessor :referenced_object_type
58+
59+
# Represents a formula that is used to compute a calculated property.
60+
attr_accessor :calculation_formula
61+
5362
class EnumAttributeValidator
5463
attr_reader :datatype
5564
attr_reader :allowable_values
@@ -85,7 +94,10 @@ def self.attribute_map
8594
:'display_order' => :'displayOrder',
8695
:'has_unique_value' => :'hasUniqueValue',
8796
:'hidden' => :'hidden',
88-
:'form_field' => :'formField'
97+
:'form_field' => :'formField',
98+
:'external_options' => :'externalOptions',
99+
:'referenced_object_type' => :'referencedObjectType',
100+
:'calculation_formula' => :'calculationFormula'
89101
}
90102
end
91103

@@ -107,7 +119,10 @@ def self.openapi_types
107119
:'display_order' => :'Integer',
108120
:'has_unique_value' => :'Boolean',
109121
:'hidden' => :'Boolean',
110-
:'form_field' => :'Boolean'
122+
:'form_field' => :'Boolean',
123+
:'external_options' => :'Boolean',
124+
:'referenced_object_type' => :'String',
125+
:'calculation_formula' => :'String'
111126
}
112127
end
113128

@@ -177,6 +192,18 @@ def initialize(attributes = {})
177192
if attributes.key?(:'form_field')
178193
self.form_field = attributes[:'form_field']
179194
end
195+
196+
if attributes.key?(:'external_options')
197+
self.external_options = attributes[:'external_options']
198+
end
199+
200+
if attributes.key?(:'referenced_object_type')
201+
self.referenced_object_type = attributes[:'referenced_object_type']
202+
end
203+
204+
if attributes.key?(:'calculation_formula')
205+
self.calculation_formula = attributes[:'calculation_formula']
206+
end
180207
end
181208

182209
# Show invalid properties with the reasons. Usually used together with valid?
@@ -212,10 +239,10 @@ def valid?
212239
return false if @name.nil?
213240
return false if @label.nil?
214241
return false if @type.nil?
215-
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
242+
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
216243
return false unless type_validator.valid?(@type)
217244
return false if @field_type.nil?
218-
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
245+
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
219246
return false unless field_type_validator.valid?(@field_type)
220247
return false if @group_name.nil?
221248
true
@@ -224,7 +251,7 @@ def valid?
224251
# Custom attribute writer method checking allowed values (enum).
225252
# @param [Object] type Object to be assigned
226253
def type=(type)
227-
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
254+
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
228255
unless validator.valid?(type)
229256
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
230257
end
@@ -234,7 +261,7 @@ def type=(type)
234261
# Custom attribute writer method checking allowed values (enum).
235262
# @param [Object] field_type Object to be assigned
236263
def field_type=(field_type)
237-
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
264+
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
238265
unless validator.valid?(field_type)
239266
fail ArgumentError, "invalid value for \"field_type\", must be one of #{validator.allowable_values}."
240267
end
@@ -256,7 +283,10 @@ def ==(o)
256283
display_order == o.display_order &&
257284
has_unique_value == o.has_unique_value &&
258285
hidden == o.hidden &&
259-
form_field == o.form_field
286+
form_field == o.form_field &&
287+
external_options == o.external_options &&
288+
referenced_object_type == o.referenced_object_type &&
289+
calculation_formula == o.calculation_formula
260290
end
261291

262292
# @see the `==` method
@@ -268,7 +298,7 @@ def eql?(o)
268298
# Calculates hash code according to all attributes.
269299
# @return [Integer] Hash code
270300
def hash
271-
[name, label, type, field_type, group_name, description, options, display_order, has_unique_value, hidden, form_field].hash
301+
[name, label, type, field_type, group_name, description, options, display_order, has_unique_value, hidden, form_field, external_options, referenced_object_type, calculation_formula].hash
272302
end
273303

274304
# Builds the object from hash

lib/hubspot/codegen/crm/properties/models/property_update.rb

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class PropertyUpdate
4444
# Whether or not the property can be used in a HubSpot form.
4545
attr_accessor :form_field
4646

47+
# Represents a formula that is used to compute a calculated property.
48+
attr_accessor :calculation_formula
49+
4750
class EnumAttributeValidator
4851
attr_reader :datatype
4952
attr_reader :allowable_values
@@ -77,7 +80,8 @@ def self.attribute_map
7780
:'options' => :'options',
7881
:'display_order' => :'displayOrder',
7982
:'hidden' => :'hidden',
80-
:'form_field' => :'formField'
83+
:'form_field' => :'formField',
84+
:'calculation_formula' => :'calculationFormula'
8185
}
8286
end
8387

@@ -97,7 +101,8 @@ def self.openapi_types
97101
:'options' => :'Array<OptionInput>',
98102
:'display_order' => :'Integer',
99103
:'hidden' => :'Boolean',
100-
:'form_field' => :'Boolean'
104+
:'form_field' => :'Boolean',
105+
:'calculation_formula' => :'String'
101106
}
102107
end
103108

@@ -159,6 +164,10 @@ def initialize(attributes = {})
159164
if attributes.key?(:'form_field')
160165
self.form_field = attributes[:'form_field']
161166
end
167+
168+
if attributes.key?(:'calculation_formula')
169+
self.calculation_formula = attributes[:'calculation_formula']
170+
end
162171
end
163172

164173
# Show invalid properties with the reasons. Usually used together with valid?
@@ -171,17 +180,17 @@ def list_invalid_properties
171180
# Check to see if the all the properties in the model are valid
172181
# @return true if the model is valid
173182
def valid?
174-
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
183+
type_validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
175184
return false unless type_validator.valid?(@type)
176-
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
185+
field_type_validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
177186
return false unless field_type_validator.valid?(@field_type)
178187
true
179188
end
180189

181190
# Custom attribute writer method checking allowed values (enum).
182191
# @param [Object] type Object to be assigned
183192
def type=(type)
184-
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration"])
193+
validator = EnumAttributeValidator.new('String', ["string", "number", "date", "datetime", "enumeration", "bool"])
185194
unless validator.valid?(type)
186195
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
187196
end
@@ -191,7 +200,7 @@ def type=(type)
191200
# Custom attribute writer method checking allowed values (enum).
192201
# @param [Object] field_type Object to be assigned
193202
def field_type=(field_type)
194-
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox"])
203+
validator = EnumAttributeValidator.new('String', ["textarea", "text", "date", "file", "number", "select", "radio", "checkbox", "booleancheckbox", "calculation_equation"])
195204
unless validator.valid?(field_type)
196205
fail ArgumentError, "invalid value for \"field_type\", must be one of #{validator.allowable_values}."
197206
end
@@ -211,7 +220,8 @@ def ==(o)
211220
options == o.options &&
212221
display_order == o.display_order &&
213222
hidden == o.hidden &&
214-
form_field == o.form_field
223+
form_field == o.form_field &&
224+
calculation_formula == o.calculation_formula
215225
end
216226

217227
# @see the `==` method
@@ -223,7 +233,7 @@ def eql?(o)
223233
# Calculates hash code according to all attributes.
224234
# @return [Integer] Hash code
225235
def hash
226-
[label, type, field_type, group_name, description, options, display_order, hidden, form_field].hash
236+
[label, type, field_type, group_name, description, options, display_order, hidden, form_field, calculation_formula].hash
227237
end
228238

229239
# Builds the object from hash

0 commit comments

Comments
 (0)