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,285 @@
1
+ =begin
2
+ #Postal Mail
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 PostalMail
20
+ class ValueWithTimestamp
21
+ attr_accessor :value
22
+
23
+ attr_accessor :timestamp
24
+
25
+ attr_accessor :source_type
26
+
27
+ attr_accessor :source_id
28
+
29
+ attr_accessor :source_label
30
+
31
+ attr_accessor :updated_by_user_id
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'value' => :'value',
37
+ :'timestamp' => :'timestamp',
38
+ :'source_type' => :'sourceType',
39
+ :'source_id' => :'sourceId',
40
+ :'source_label' => :'sourceLabel',
41
+ :'updated_by_user_id' => :'updatedByUserId'
42
+ }
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'value' => :'String',
54
+ :'timestamp' => :'Time',
55
+ :'source_type' => :'String',
56
+ :'source_id' => :'String',
57
+ :'source_label' => :'String',
58
+ :'updated_by_user_id' => :'Integer'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Objects::PostalMail::ValueWithTimestamp` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Objects::PostalMail::ValueWithTimestamp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'value')
84
+ self.value = attributes[:'value']
85
+ end
86
+
87
+ if attributes.key?(:'timestamp')
88
+ self.timestamp = attributes[:'timestamp']
89
+ end
90
+
91
+ if attributes.key?(:'source_type')
92
+ self.source_type = attributes[:'source_type']
93
+ end
94
+
95
+ if attributes.key?(:'source_id')
96
+ self.source_id = attributes[:'source_id']
97
+ end
98
+
99
+ if attributes.key?(:'source_label')
100
+ self.source_label = attributes[:'source_label']
101
+ end
102
+
103
+ if attributes.key?(:'updated_by_user_id')
104
+ self.updated_by_user_id = attributes[:'updated_by_user_id']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ if @value.nil?
113
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
114
+ end
115
+
116
+ if @timestamp.nil?
117
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
118
+ end
119
+
120
+ if @source_type.nil?
121
+ invalid_properties.push('invalid value for "source_type", source_type cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ return false if @value.nil?
131
+ return false if @timestamp.nil?
132
+ return false if @source_type.nil?
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ value == o.value &&
142
+ timestamp == o.timestamp &&
143
+ source_type == o.source_type &&
144
+ source_id == o.source_id &&
145
+ source_label == o.source_label &&
146
+ updated_by_user_id == o.updated_by_user_id
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [value, timestamp, source_type, source_id, source_label, updated_by_user_id].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ new.build_from_hash(attributes)
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
176
+ self.send("#{key}=", nil)
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = Hubspot::Crm::Objects::PostalMail.const_get(type)
230
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+
282
+ end
283
+ end
284
+ end
285
+ end
@@ -22,26 +22,26 @@ module Hubspot
22
22
  def initialize(api_client = ApiClient.default)
23
23
  @api_client = api_client
24
24
  end
25
- # Remove an association between two tasks
26
- # @param task_id [String]
25
+ # Delete
26
+ # deletes all associations between two records.
27
+ # @param task_id [Integer]
27
28
  # @param to_object_type [String]
28
- # @param to_object_id [String]
29
- # @param association_type [String]
29
+ # @param to_object_id [Integer]
30
30
  # @param [Hash] opts the optional parameters
31
31
  # @return [nil]
32
- def archive(task_id, to_object_type, to_object_id, association_type, opts = {})
33
- archive_with_http_info(task_id, to_object_type, to_object_id, association_type, opts)
32
+ def archive(task_id, to_object_type, to_object_id, opts = {})
33
+ archive_with_http_info(task_id, to_object_type, to_object_id, opts)
34
34
  nil
35
35
  end
36
36
 
37
- # Remove an association between two tasks
38
- # @param task_id [String]
37
+ # Delete
38
+ # deletes all associations between two records.
39
+ # @param task_id [Integer]
39
40
  # @param to_object_type [String]
40
- # @param to_object_id [String]
41
- # @param association_type [String]
41
+ # @param to_object_id [Integer]
42
42
  # @param [Hash] opts the optional parameters
43
43
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
44
- def archive_with_http_info(task_id, to_object_type, to_object_id, association_type, opts = {})
44
+ def archive_with_http_info(task_id, to_object_type, to_object_id, opts = {})
45
45
  if @api_client.config.debugging
46
46
  @api_client.config.logger.debug 'Calling API: AssociationsApi.archive ...'
47
47
  end
@@ -57,12 +57,8 @@ module Hubspot
57
57
  if @api_client.config.client_side_validation && to_object_id.nil?
58
58
  fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.archive"
59
59
  end
60
- # verify the required parameter 'association_type' is set
61
- if @api_client.config.client_side_validation && association_type.nil?
62
- fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.archive"
63
- end
64
60
  # resource path
65
- local_var_path = '/crm/v4/objects/tasks/{taskId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'taskId' + '}', CGI.escape(task_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s)).sub('{' + 'associationType' + '}', CGI.escape(association_type.to_s))
61
+ local_var_path = '/crm/v4/objects/tasks/{taskId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'taskId' + '}', CGI.escape(task_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
66
62
 
67
63
  # query parameters
68
64
  query_params = opts[:query_params] || {}
@@ -101,26 +97,28 @@ module Hubspot
101
97
  return data, status_code, headers
102
98
  end
103
99
 
104
- # Associate a task with another object
105
- # @param task_id [String]
100
+ # Create
101
+ # Set association labels between two records.
102
+ # @param task_id [Integer]
106
103
  # @param to_object_type [String]
107
- # @param to_object_id [String]
108
- # @param association_type [String]
104
+ # @param to_object_id [Integer]
105
+ # @param association_spec [Array<AssociationSpec>]
109
106
  # @param [Hash] opts the optional parameters
110
- # @return [SimplePublicObjectWithAssociations]
111
- def create(task_id, to_object_type, to_object_id, association_type, opts = {})
112
- data, _status_code, _headers = create_with_http_info(task_id, to_object_type, to_object_id, association_type, opts)
107
+ # @return [LabelsBetweenObjectPair]
108
+ def create(task_id, to_object_type, to_object_id, association_spec, opts = {})
109
+ data, _status_code, _headers = create_with_http_info(task_id, to_object_type, to_object_id, association_spec, opts)
113
110
  data
114
111
  end
115
112
 
116
- # Associate a task with another object
117
- # @param task_id [String]
113
+ # Create
114
+ # Set association labels between two records.
115
+ # @param task_id [Integer]
118
116
  # @param to_object_type [String]
119
- # @param to_object_id [String]
120
- # @param association_type [String]
117
+ # @param to_object_id [Integer]
118
+ # @param association_spec [Array<AssociationSpec>]
121
119
  # @param [Hash] opts the optional parameters
122
- # @return [Array<(SimplePublicObjectWithAssociations, Integer, Hash)>] SimplePublicObjectWithAssociations data, response status code and response headers
123
- def create_with_http_info(task_id, to_object_type, to_object_id, association_type, opts = {})
120
+ # @return [Array<(LabelsBetweenObjectPair, Integer, Hash)>] LabelsBetweenObjectPair data, response status code and response headers
121
+ def create_with_http_info(task_id, to_object_type, to_object_id, association_spec, opts = {})
124
122
  if @api_client.config.debugging
125
123
  @api_client.config.logger.debug 'Calling API: AssociationsApi.create ...'
126
124
  end
@@ -136,12 +134,12 @@ module Hubspot
136
134
  if @api_client.config.client_side_validation && to_object_id.nil?
137
135
  fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.create"
138
136
  end
139
- # verify the required parameter 'association_type' is set
140
- if @api_client.config.client_side_validation && association_type.nil?
141
- fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.create"
137
+ # verify the required parameter 'association_spec' is set
138
+ if @api_client.config.client_side_validation && association_spec.nil?
139
+ fail ArgumentError, "Missing the required parameter 'association_spec' when calling AssociationsApi.create"
142
140
  end
143
141
  # resource path
144
- local_var_path = '/crm/v4/objects/tasks/{taskId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'taskId' + '}', CGI.escape(task_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s)).sub('{' + 'associationType' + '}', CGI.escape(association_type.to_s))
142
+ local_var_path = '/crm/v4/objects/tasks/{taskId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'taskId' + '}', CGI.escape(task_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
145
143
 
146
144
  # query parameters
147
145
  query_params = opts[:query_params] || {}
@@ -150,15 +148,20 @@ module Hubspot
150
148
  header_params = opts[:header_params] || {}
151
149
  # HTTP header 'Accept' (if needed)
152
150
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
151
+ # HTTP header 'Content-Type'
152
+ content_type = @api_client.select_header_content_type(['application/json'])
153
+ if !content_type.nil?
154
+ header_params['Content-Type'] = content_type
155
+ end
153
156
 
154
157
  # form parameters
155
158
  form_params = opts[:form_params] || {}
156
159
 
157
160
  # http body (model)
158
- post_body = opts[:debug_body]
161
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(association_spec)
159
162
 
160
163
  # return_type
161
- return_type = opts[:debug_return_type] || 'SimplePublicObjectWithAssociations'
164
+ return_type = opts[:debug_return_type] || 'LabelsBetweenObjectPair'
162
165
 
163
166
  # auth_names
164
167
  auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
@@ -180,25 +183,27 @@ module Hubspot
180
183
  return data, status_code, headers
181
184
  end
182
185
 
183
- # List associations of a task by type
184
- # @param task_id [String]
186
+ # List
187
+ # List all associations of a task by object type. Limit 1000 per call.
188
+ # @param task_id [Integer]
185
189
  # @param to_object_type [String]
186
190
  # @param [Hash] opts the optional parameters
187
191
  # @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
188
192
  # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
189
- # @return [CollectionResponseAssociatedIdForwardPaging]
193
+ # @return [CollectionResponseMultiAssociatedObjectWithLabelForwardPaging]
190
194
  def get_all(task_id, to_object_type, opts = {})
191
195
  data, _status_code, _headers = get_all_with_http_info(task_id, to_object_type, opts)
192
196
  data
193
197
  end
194
198
 
195
- # List associations of a task by type
196
- # @param task_id [String]
199
+ # List
200
+ # List all associations of a task by object type. Limit 1000 per call.
201
+ # @param task_id [Integer]
197
202
  # @param to_object_type [String]
198
203
  # @param [Hash] opts the optional parameters
199
204
  # @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
200
205
  # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
201
- # @return [Array<(CollectionResponseAssociatedIdForwardPaging, Integer, Hash)>] CollectionResponseAssociatedIdForwardPaging data, response status code and response headers
206
+ # @return [Array<(CollectionResponseMultiAssociatedObjectWithLabelForwardPaging, Integer, Hash)>] CollectionResponseMultiAssociatedObjectWithLabelForwardPaging data, response status code and response headers
202
207
  def get_all_with_http_info(task_id, to_object_type, opts = {})
203
208
  if @api_client.config.debugging
204
209
  @api_client.config.logger.debug 'Calling API: AssociationsApi.get_all ...'
@@ -231,7 +236,7 @@ module Hubspot
231
236
  post_body = opts[:debug_body]
232
237
 
233
238
  # return_type
234
- return_type = opts[:debug_return_type] || 'CollectionResponseAssociatedIdForwardPaging'
239
+ return_type = opts[:debug_return_type] || 'CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'
235
240
 
236
241
  # auth_names
237
242
  auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']