hubspot-api-client 16.0.3 → 16.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -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/postal_mail/api/associations_api.rb +264 -0
  69. data/lib/hubspot/codegen/crm/objects/postal_mail/api/basic_api.rb +391 -0
  70. data/lib/hubspot/codegen/crm/objects/postal_mail/api/batch_api.rb +295 -0
  71. data/lib/hubspot/codegen/crm/objects/postal_mail/api/public_object_api.rb +94 -0
  72. data/lib/hubspot/codegen/crm/objects/postal_mail/api/search_api.rb +92 -0
  73. data/lib/hubspot/codegen/crm/objects/postal_mail/api_client.rb +412 -0
  74. data/lib/hubspot/codegen/crm/objects/postal_mail/api_error.rb +63 -0
  75. data/lib/hubspot/codegen/crm/objects/postal_mail/configuration.rb +296 -0
  76. data/lib/hubspot/codegen/crm/objects/postal_mail/models/associated_id.rb +244 -0
  77. data/lib/hubspot/codegen/crm/objects/postal_mail/models/association_spec.rb +278 -0
  78. data/lib/hubspot/codegen/crm/objects/postal_mail/models/association_spec_with_label.rb +287 -0
  79. data/lib/hubspot/codegen/crm/objects/postal_mail/models/batch_input_simple_public_object_batch_input.rb +232 -0
  80. data/lib/hubspot/codegen/crm/objects/postal_mail/models/batch_input_simple_public_object_id.rb +232 -0
  81. data/lib/hubspot/codegen/crm/objects/postal_mail/models/batch_input_simple_public_object_input.rb +232 -0
  82. data/lib/hubspot/codegen/crm/objects/postal_mail/models/batch_read_input_simple_public_object_id.rb +273 -0
  83. data/lib/hubspot/codegen/crm/objects/postal_mail/models/batch_response_simple_public_object.rb +328 -0
  84. data/lib/hubspot/codegen/crm/objects/postal_mail/models/batch_response_simple_public_object_with_errors.rb +348 -0
  85. data/lib/hubspot/codegen/crm/objects/postal_mail/models/collection_response_associated_id.rb +241 -0
  86. data/lib/hubspot/codegen/crm/objects/postal_mail/models/collection_response_multi_associated_object_with_label_forward_paging.rb +241 -0
  87. data/lib/hubspot/codegen/crm/objects/postal_mail/models/collection_response_simple_public_object_with_associations_forward_paging.rb +241 -0
  88. data/lib/hubspot/codegen/crm/objects/postal_mail/models/collection_response_with_total_simple_public_object_forward_paging.rb +255 -0
  89. data/lib/hubspot/codegen/crm/objects/postal_mail/models/error.rb +307 -0
  90. data/lib/hubspot/codegen/crm/objects/postal_mail/models/error_category.rb +278 -0
  91. data/lib/hubspot/codegen/crm/objects/postal_mail/models/error_detail.rb +273 -0
  92. data/lib/hubspot/codegen/crm/objects/postal_mail/models/filter.rb +299 -0
  93. data/lib/hubspot/codegen/crm/objects/postal_mail/models/filter_group.rb +232 -0
  94. data/lib/hubspot/codegen/crm/objects/postal_mail/models/forward_paging.rb +225 -0
  95. data/lib/hubspot/codegen/crm/objects/postal_mail/models/labels_between_object_pair.rb +288 -0
  96. data/lib/hubspot/codegen/crm/objects/postal_mail/models/multi_associated_object_with_label.rb +246 -0
  97. data/lib/hubspot/codegen/crm/objects/postal_mail/models/next_page.rb +239 -0
  98. data/lib/hubspot/codegen/crm/objects/postal_mail/models/paging.rb +234 -0
  99. data/lib/hubspot/codegen/crm/objects/postal_mail/models/previous_page.rb +239 -0
  100. data/lib/hubspot/codegen/crm/objects/postal_mail/models/public_merge_input.rb +244 -0
  101. data/lib/hubspot/codegen/crm/objects/postal_mail/models/public_object_search_request.rb +301 -0
  102. data/lib/hubspot/codegen/crm/objects/postal_mail/models/simple_public_object.rb +303 -0
  103. data/lib/hubspot/codegen/crm/objects/postal_mail/models/simple_public_object_batch_input.rb +246 -0
  104. data/lib/hubspot/codegen/crm/objects/postal_mail/models/simple_public_object_id.rb +230 -0
  105. data/lib/hubspot/codegen/crm/objects/postal_mail/models/simple_public_object_input.rb +232 -0
  106. data/lib/hubspot/codegen/crm/objects/postal_mail/models/simple_public_object_with_associations.rb +314 -0
  107. data/lib/hubspot/codegen/crm/objects/postal_mail/models/standard_error.rb +324 -0
  108. data/lib/hubspot/codegen/crm/objects/postal_mail/models/value_with_timestamp.rb +285 -0
  109. data/lib/hubspot/codegen/crm/objects/tasks/api/associations_api.rb +47 -42
  110. data/lib/hubspot/codegen/crm/objects/tasks/models/association_spec.rb +278 -0
  111. data/lib/hubspot/codegen/crm/objects/tasks/models/association_spec_with_label.rb +287 -0
  112. 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
  113. data/lib/hubspot/codegen/crm/objects/tasks/models/labels_between_object_pair.rb +288 -0
  114. data/lib/hubspot/codegen/crm/objects/tasks/models/multi_associated_object_with_label.rb +246 -0
  115. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +47 -42
  116. data/lib/hubspot/codegen/crm/products/models/association_spec.rb +276 -0
  117. data/lib/hubspot/codegen/crm/products/models/association_spec_with_label.rb +285 -0
  118. 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
  119. data/lib/hubspot/codegen/crm/products/models/labels_between_object_pair.rb +286 -0
  120. data/lib/hubspot/codegen/crm/products/models/multi_associated_object_with_label.rb +244 -0
  121. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +47 -42
  122. data/lib/hubspot/codegen/crm/quotes/models/association_spec.rb +276 -0
  123. data/lib/hubspot/codegen/crm/quotes/models/association_spec_with_label.rb +285 -0
  124. 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
  125. data/lib/hubspot/codegen/crm/quotes/models/labels_between_object_pair.rb +286 -0
  126. data/lib/hubspot/codegen/crm/quotes/models/multi_associated_object_with_label.rb +244 -0
  127. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +47 -42
  128. data/lib/hubspot/codegen/crm/tickets/models/association_spec.rb +276 -0
  129. data/lib/hubspot/codegen/crm/tickets/models/association_spec_with_label.rb +285 -0
  130. 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
  131. data/lib/hubspot/codegen/crm/tickets/models/labels_between_object_pair.rb +286 -0
  132. data/lib/hubspot/codegen/crm/tickets/models/multi_associated_object_with_label.rb +244 -0
  133. data/lib/hubspot/codegen/marketing/events/api/attendance_subscriber_state_changes_api.rb +2 -2
  134. data/lib/hubspot/codegen/marketing/events/api/marketing_events_external_api.rb +12 -12
  135. data/lib/hubspot/codegen/marketing/events/models/property_value.rb +13 -4
  136. data/lib/hubspot/discovery/crm/objects/client.rb +1 -0
  137. data/lib/hubspot/discovery/crm/objects/postal_mail/api/associations_api.rb +15 -0
  138. data/lib/hubspot/discovery/crm/objects/postal_mail/api/basic_api.rb +15 -0
  139. data/lib/hubspot/discovery/crm/objects/postal_mail/api/batch_api.rb +15 -0
  140. data/lib/hubspot/discovery/crm/objects/postal_mail/api/public_object_api.rb +15 -0
  141. data/lib/hubspot/discovery/crm/objects/postal_mail/api/search_api.rb +15 -0
  142. data/lib/hubspot/discovery/crm/objects/postal_mail/client.rb +25 -0
  143. data/lib/hubspot/version.rb +1 -1
  144. data/spec/discovery/crm/objects/postal_mail/associations_api_spec.rb +9 -0
  145. data/spec/discovery/crm/objects/postal_mail/basic_api_spec.rb +10 -0
  146. data/spec/discovery/crm/objects/postal_mail/batch_api_spec.rb +10 -0
  147. data/spec/discovery/crm/objects/postal_mail/public_object_api_spec.rb +7 -0
  148. data/spec/discovery/crm/objects/postal_mail/search_api_spec.rb +7 -0
  149. metadata +125 -16
@@ -0,0 +1,288 @@
1
+ =begin
2
+ #Calls
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 Objects
19
+ module Calls
20
+ class LabelsBetweenObjectPair
21
+ attr_accessor :from_object_type_id
22
+
23
+ attr_accessor :from_object_id
24
+
25
+ attr_accessor :to_object_type_id
26
+
27
+ attr_accessor :to_object_id
28
+
29
+ attr_accessor :labels
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'from_object_type_id' => :'fromObjectTypeId',
35
+ :'from_object_id' => :'fromObjectId',
36
+ :'to_object_type_id' => :'toObjectTypeId',
37
+ :'to_object_id' => :'toObjectId',
38
+ :'labels' => :'labels'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'from_object_type_id' => :'String',
51
+ :'from_object_id' => :'Integer',
52
+ :'to_object_type_id' => :'String',
53
+ :'to_object_id' => :'Integer',
54
+ :'labels' => :'Array<String>'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Objects::Calls::LabelsBetweenObjectPair` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Objects::Calls::LabelsBetweenObjectPair`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'from_object_type_id')
80
+ self.from_object_type_id = attributes[:'from_object_type_id']
81
+ end
82
+
83
+ if attributes.key?(:'from_object_id')
84
+ self.from_object_id = attributes[:'from_object_id']
85
+ end
86
+
87
+ if attributes.key?(:'to_object_type_id')
88
+ self.to_object_type_id = attributes[:'to_object_type_id']
89
+ end
90
+
91
+ if attributes.key?(:'to_object_id')
92
+ self.to_object_id = attributes[:'to_object_id']
93
+ end
94
+
95
+ if attributes.key?(:'labels')
96
+ if (value = attributes[:'labels']).is_a?(Array)
97
+ self.labels = value
98
+ end
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ if @from_object_type_id.nil?
107
+ invalid_properties.push('invalid value for "from_object_type_id", from_object_type_id cannot be nil.')
108
+ end
109
+
110
+ if @from_object_id.nil?
111
+ invalid_properties.push('invalid value for "from_object_id", from_object_id cannot be nil.')
112
+ end
113
+
114
+ if @to_object_type_id.nil?
115
+ invalid_properties.push('invalid value for "to_object_type_id", to_object_type_id cannot be nil.')
116
+ end
117
+
118
+ if @to_object_id.nil?
119
+ invalid_properties.push('invalid value for "to_object_id", to_object_id cannot be nil.')
120
+ end
121
+
122
+ if @labels.nil?
123
+ invalid_properties.push('invalid value for "labels", labels cannot be nil.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ return false if @from_object_type_id.nil?
133
+ return false if @from_object_id.nil?
134
+ return false if @to_object_type_id.nil?
135
+ return false if @to_object_id.nil?
136
+ return false if @labels.nil?
137
+ true
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
+ from_object_type_id == o.from_object_type_id &&
146
+ from_object_id == o.from_object_id &&
147
+ to_object_type_id == o.to_object_type_id &&
148
+ to_object_id == o.to_object_id &&
149
+ labels == o.labels
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ def hash
161
+ [from_object_type_id, from_object_id, to_object_type_id, to_object_id, labels].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def self.build_from_hash(attributes)
168
+ new.build_from_hash(attributes)
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ self.class.openapi_types.each_pair do |key, type|
178
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
179
+ self.send("#{key}=", nil)
180
+ elsif type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
184
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ end
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :Time
201
+ Time.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ # models (e.g. Pet) or oneOf
232
+ klass = Hubspot::Crm::Objects::Calls.const_get(type)
233
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end
286
+ end
287
+ end
288
+ end
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Calls
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 Objects
19
+ module Calls
20
+ class MultiAssociatedObjectWithLabel
21
+ attr_accessor :to_object_id
22
+
23
+ attr_accessor :association_types
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'to_object_id' => :'toObjectId',
29
+ :'association_types' => :'associationTypes'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'to_object_id' => :'Integer',
42
+ :'association_types' => :'Array<AssociationSpecWithLabel>'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Objects::Calls::MultiAssociatedObjectWithLabel` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Objects::Calls::MultiAssociatedObjectWithLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'to_object_id')
68
+ self.to_object_id = attributes[:'to_object_id']
69
+ end
70
+
71
+ if attributes.key?(:'association_types')
72
+ if (value = attributes[:'association_types']).is_a?(Array)
73
+ self.association_types = value
74
+ end
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ if @to_object_id.nil?
83
+ invalid_properties.push('invalid value for "to_object_id", to_object_id cannot be nil.')
84
+ end
85
+
86
+ if @association_types.nil?
87
+ invalid_properties.push('invalid value for "association_types", association_types cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return false if @to_object_id.nil?
97
+ return false if @association_types.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ to_object_id == o.to_object_id &&
107
+ association_types == o.association_types
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ def hash
119
+ [to_object_id, association_types].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def self.build_from_hash(attributes)
126
+ new.build_from_hash(attributes)
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137
+ self.send("#{key}=", nil)
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :Time
159
+ Time.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ # models (e.g. Pet) or oneOf
190
+ klass = Hubspot::Crm::Objects::Calls.const_get(type)
191
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+
243
+ end
244
+ end
245
+ end
246
+ end