hubspot-api-client 16.0.3 → 16.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile.lock +1 -1
  4. data/lib/hubspot/codegen/cms/domains/api/domains_api.rb +2 -2
  5. data/lib/hubspot/codegen/cms/domains/configuration.rb +7 -0
  6. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +47 -42
  7. data/lib/hubspot/codegen/crm/companies/models/association_spec.rb +276 -0
  8. data/lib/hubspot/codegen/crm/companies/models/association_spec_with_label.rb +285 -0
  9. data/lib/hubspot/codegen/crm/companies/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  10. data/lib/hubspot/codegen/crm/companies/models/labels_between_object_pair.rb +286 -0
  11. data/lib/hubspot/codegen/crm/companies/models/multi_associated_object_with_label.rb +244 -0
  12. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +47 -42
  13. data/lib/hubspot/codegen/crm/contacts/models/association_spec.rb +276 -0
  14. data/lib/hubspot/codegen/crm/contacts/models/association_spec_with_label.rb +285 -0
  15. data/lib/hubspot/codegen/crm/contacts/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  16. data/lib/hubspot/codegen/crm/contacts/models/labels_between_object_pair.rb +286 -0
  17. data/lib/hubspot/codegen/crm/contacts/models/multi_associated_object_with_label.rb +244 -0
  18. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +47 -42
  19. data/lib/hubspot/codegen/crm/deals/models/association_spec.rb +276 -0
  20. data/lib/hubspot/codegen/crm/deals/models/association_spec_with_label.rb +285 -0
  21. data/lib/hubspot/codegen/crm/deals/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  22. data/lib/hubspot/codegen/crm/deals/models/labels_between_object_pair.rb +286 -0
  23. data/lib/hubspot/codegen/crm/deals/models/multi_associated_object_with_label.rb +244 -0
  24. data/lib/hubspot/codegen/crm/imports/api/core_api.rb +2 -2
  25. data/lib/hubspot/codegen/crm/imports/api/public_imports_api.rb +1 -1
  26. data/lib/hubspot/codegen/crm/imports/models/import_row_core.rb +34 -18
  27. data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +19 -19
  28. data/lib/hubspot/codegen/crm/imports/models/public_import_response.rb +2 -2
  29. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +47 -42
  30. data/lib/hubspot/codegen/crm/line_items/models/association_spec.rb +276 -0
  31. data/lib/hubspot/codegen/crm/line_items/models/association_spec_with_label.rb +285 -0
  32. data/lib/hubspot/codegen/crm/line_items/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  33. data/lib/hubspot/codegen/crm/line_items/models/labels_between_object_pair.rb +286 -0
  34. data/lib/hubspot/codegen/crm/line_items/models/multi_associated_object_with_label.rb +244 -0
  35. data/lib/hubspot/codegen/crm/objects/calls/api/associations_api.rb +47 -42
  36. data/lib/hubspot/codegen/crm/objects/calls/models/association_spec.rb +278 -0
  37. data/lib/hubspot/codegen/crm/objects/calls/models/association_spec_with_label.rb +287 -0
  38. data/lib/hubspot/codegen/crm/objects/calls/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  39. data/lib/hubspot/codegen/crm/objects/calls/models/labels_between_object_pair.rb +288 -0
  40. data/lib/hubspot/codegen/crm/objects/calls/models/multi_associated_object_with_label.rb +246 -0
  41. data/lib/hubspot/codegen/crm/objects/emails/api/associations_api.rb +48 -43
  42. data/lib/hubspot/codegen/crm/objects/emails/api/basic_api.rb +2 -2
  43. data/lib/hubspot/codegen/crm/objects/emails/api/batch_api.rb +1 -1
  44. data/lib/hubspot/codegen/crm/objects/emails/api/search_api.rb +1 -1
  45. data/lib/hubspot/codegen/crm/objects/emails/models/association_spec.rb +278 -0
  46. data/lib/hubspot/codegen/crm/objects/emails/models/association_spec_with_label.rb +287 -0
  47. data/lib/hubspot/codegen/crm/objects/emails/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  48. data/lib/hubspot/codegen/crm/objects/emails/models/labels_between_object_pair.rb +288 -0
  49. data/lib/hubspot/codegen/crm/objects/emails/models/multi_associated_object_with_label.rb +246 -0
  50. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +47 -42
  51. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/association_spec.rb +278 -0
  52. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/association_spec_with_label.rb +287 -0
  53. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  54. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/labels_between_object_pair.rb +288 -0
  55. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/multi_associated_object_with_label.rb +246 -0
  56. data/lib/hubspot/codegen/crm/objects/meetings/api/associations_api.rb +47 -42
  57. data/lib/hubspot/codegen/crm/objects/meetings/models/association_spec.rb +278 -0
  58. data/lib/hubspot/codegen/crm/objects/meetings/models/association_spec_with_label.rb +287 -0
  59. data/lib/hubspot/codegen/crm/objects/meetings/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  60. data/lib/hubspot/codegen/crm/objects/meetings/models/labels_between_object_pair.rb +288 -0
  61. data/lib/hubspot/codegen/crm/objects/meetings/models/multi_associated_object_with_label.rb +246 -0
  62. data/lib/hubspot/codegen/crm/objects/notes/api/associations_api.rb +47 -42
  63. data/lib/hubspot/codegen/crm/objects/notes/models/association_spec.rb +278 -0
  64. data/lib/hubspot/codegen/crm/objects/notes/models/association_spec_with_label.rb +287 -0
  65. data/lib/hubspot/codegen/crm/objects/notes/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  66. data/lib/hubspot/codegen/crm/objects/notes/models/labels_between_object_pair.rb +288 -0
  67. data/lib/hubspot/codegen/crm/objects/notes/models/multi_associated_object_with_label.rb +246 -0
  68. data/lib/hubspot/codegen/crm/objects/tasks/api/associations_api.rb +47 -42
  69. data/lib/hubspot/codegen/crm/objects/tasks/models/association_spec.rb +278 -0
  70. data/lib/hubspot/codegen/crm/objects/tasks/models/association_spec_with_label.rb +287 -0
  71. data/lib/hubspot/codegen/crm/objects/tasks/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  72. data/lib/hubspot/codegen/crm/objects/tasks/models/labels_between_object_pair.rb +288 -0
  73. data/lib/hubspot/codegen/crm/objects/tasks/models/multi_associated_object_with_label.rb +246 -0
  74. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +47 -42
  75. data/lib/hubspot/codegen/crm/products/models/association_spec.rb +276 -0
  76. data/lib/hubspot/codegen/crm/products/models/association_spec_with_label.rb +285 -0
  77. data/lib/hubspot/codegen/crm/products/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  78. data/lib/hubspot/codegen/crm/products/models/labels_between_object_pair.rb +286 -0
  79. data/lib/hubspot/codegen/crm/products/models/multi_associated_object_with_label.rb +244 -0
  80. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +47 -42
  81. data/lib/hubspot/codegen/crm/quotes/models/association_spec.rb +276 -0
  82. data/lib/hubspot/codegen/crm/quotes/models/association_spec_with_label.rb +285 -0
  83. data/lib/hubspot/codegen/crm/quotes/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  84. data/lib/hubspot/codegen/crm/quotes/models/labels_between_object_pair.rb +286 -0
  85. data/lib/hubspot/codegen/crm/quotes/models/multi_associated_object_with_label.rb +244 -0
  86. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +47 -42
  87. data/lib/hubspot/codegen/crm/tickets/models/association_spec.rb +276 -0
  88. data/lib/hubspot/codegen/crm/tickets/models/association_spec_with_label.rb +285 -0
  89. data/lib/hubspot/codegen/crm/tickets/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
  90. data/lib/hubspot/codegen/crm/tickets/models/labels_between_object_pair.rb +286 -0
  91. data/lib/hubspot/codegen/crm/tickets/models/multi_associated_object_with_label.rb +244 -0
  92. data/lib/hubspot/codegen/marketing/events/api/attendance_subscriber_state_changes_api.rb +2 -2
  93. data/lib/hubspot/codegen/marketing/events/api/marketing_events_external_api.rb +12 -12
  94. data/lib/hubspot/version.rb +1 -1
  95. metadata +68 -16
@@ -0,0 +1,276 @@
1
+ =begin
2
+ #Products
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Hubspot
17
+ module Crm
18
+ module Products
19
+ class AssociationSpec
20
+ attr_accessor :association_category
21
+
22
+ attr_accessor :association_type_id
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'association_category' => :'associationCategory',
50
+ :'association_type_id' => :'associationTypeId'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'association_category' => :'String',
63
+ :'association_type_id' => :'Integer'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Products::AssociationSpec` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Products::AssociationSpec`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'association_category')
89
+ self.association_category = attributes[:'association_category']
90
+ end
91
+
92
+ if attributes.key?(:'association_type_id')
93
+ self.association_type_id = attributes[:'association_type_id']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ invalid_properties = Array.new
101
+ if @association_category.nil?
102
+ invalid_properties.push('invalid value for "association_category", association_category cannot be nil.')
103
+ end
104
+
105
+ if @association_type_id.nil?
106
+ invalid_properties.push('invalid value for "association_type_id", association_type_id cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @association_category.nil?
116
+ association_category_validator = EnumAttributeValidator.new('String', ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"])
117
+ return false unless association_category_validator.valid?(@association_category)
118
+ return false if @association_type_id.nil?
119
+ true
120
+ end
121
+
122
+ # Custom attribute writer method checking allowed values (enum).
123
+ # @param [Object] association_category Object to be assigned
124
+ def association_category=(association_category)
125
+ validator = EnumAttributeValidator.new('String', ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"])
126
+ unless validator.valid?(association_category)
127
+ fail ArgumentError, "invalid value for \"association_category\", must be one of #{validator.allowable_values}."
128
+ end
129
+ @association_category = association_category
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ association_category == o.association_category &&
138
+ association_type_id == o.association_type_id
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Integer] Hash code
149
+ def hash
150
+ [association_category, association_type_id].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def self.build_from_hash(attributes)
157
+ new.build_from_hash(attributes)
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ self.class.openapi_types.each_pair do |key, type|
167
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
168
+ self.send("#{key}=", nil)
169
+ elsif type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ end
178
+ end
179
+
180
+ self
181
+ end
182
+
183
+ # Deserializes the data based on type
184
+ # @param string type Data type
185
+ # @param string value Value to be deserialized
186
+ # @return [Object] Deserialized data
187
+ def _deserialize(type, value)
188
+ case type.to_sym
189
+ when :Time
190
+ Time.parse(value)
191
+ when :Date
192
+ Date.parse(value)
193
+ when :String
194
+ value.to_s
195
+ when :Integer
196
+ value.to_i
197
+ when :Float
198
+ value.to_f
199
+ when :Boolean
200
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
201
+ true
202
+ else
203
+ false
204
+ end
205
+ when :Object
206
+ # generic object (usually a Hash), return directly
207
+ value
208
+ when /\AArray<(?<inner_type>.+)>\z/
209
+ inner_type = Regexp.last_match[:inner_type]
210
+ value.map { |v| _deserialize(inner_type, v) }
211
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
212
+ k_type = Regexp.last_match[:k_type]
213
+ v_type = Regexp.last_match[:v_type]
214
+ {}.tap do |hash|
215
+ value.each do |k, v|
216
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
217
+ end
218
+ end
219
+ else # model
220
+ # models (e.g. Pet) or oneOf
221
+ klass = Hubspot::Crm::Products.const_get(type)
222
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end
271
+
272
+ end
273
+
274
+ end
275
+ end
276
+ end
@@ -0,0 +1,285 @@
1
+ =begin
2
+ #Products
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Hubspot
17
+ module Crm
18
+ module Products
19
+ class AssociationSpecWithLabel
20
+ attr_accessor :category
21
+
22
+ attr_accessor :type_id
23
+
24
+ attr_accessor :label
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'category' => :'category',
52
+ :'type_id' => :'typeId',
53
+ :'label' => :'label'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'category' => :'String',
66
+ :'type_id' => :'Integer',
67
+ :'label' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Products::AssociationSpecWithLabel` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Products::AssociationSpecWithLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'category')
93
+ self.category = attributes[:'category']
94
+ end
95
+
96
+ if attributes.key?(:'type_id')
97
+ self.type_id = attributes[:'type_id']
98
+ end
99
+
100
+ if attributes.key?(:'label')
101
+ self.label = attributes[:'label']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @category.nil?
110
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
111
+ end
112
+
113
+ if @type_id.nil?
114
+ invalid_properties.push('invalid value for "type_id", type_id cannot be nil.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ return false if @category.nil?
124
+ category_validator = EnumAttributeValidator.new('String', ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"])
125
+ return false unless category_validator.valid?(@category)
126
+ return false if @type_id.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method checking allowed values (enum).
131
+ # @param [Object] category Object to be assigned
132
+ def category=(category)
133
+ validator = EnumAttributeValidator.new('String', ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"])
134
+ unless validator.valid?(category)
135
+ fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}."
136
+ end
137
+ @category = category
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] Object to be compared
142
+ def ==(o)
143
+ return true if self.equal?(o)
144
+ self.class == o.class &&
145
+ category == o.category &&
146
+ type_id == o.type_id &&
147
+ label == o.label
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [category, type_id, label].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ self.class.openapi_types.each_pair do |key, type|
176
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
177
+ self.send("#{key}=", nil)
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :Time
199
+ Time.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ # models (e.g. Pet) or oneOf
230
+ klass = Hubspot::Crm::Products.const_get(type)
231
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end
284
+ end
285
+ end
@@ -16,7 +16,7 @@ require 'time'
16
16
  module Hubspot
17
17
  module Crm
18
18
  module Products
19
- class CollectionResponseAssociatedIdForwardPaging
19
+ class CollectionResponseMultiAssociatedObjectWithLabelForwardPaging
20
20
  attr_accessor :results
21
21
 
22
22
  attr_accessor :paging
@@ -37,7 +37,7 @@ module Hubspot
37
37
  # Attribute type mapping.
38
38
  def self.openapi_types
39
39
  {
40
- :'results' => :'Array<AssociatedId>',
40
+ :'results' => :'Array<MultiAssociatedObjectWithLabel>',
41
41
  :'paging' => :'ForwardPaging'
42
42
  }
43
43
  end
@@ -52,13 +52,13 @@ module Hubspot
52
52
  # @param [Hash] attributes Model attributes in the form of hash
53
53
  def initialize(attributes = {})
54
54
  if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Products::CollectionResponseAssociatedIdForwardPaging` initialize method"
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Products::CollectionResponseMultiAssociatedObjectWithLabelForwardPaging` initialize method"
56
56
  end
57
57
 
58
58
  # check to see if the attribute exists and convert string to symbol for hash key
59
59
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
60
  if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Products::CollectionResponseAssociatedIdForwardPaging`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Products::CollectionResponseMultiAssociatedObjectWithLabelForwardPaging`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
62
  end
63
63
  h[k.to_sym] = v
64
64
  }