hubspot-api-client 16.0.2 → 16.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) 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/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/discovery/base_api_client.rb +1 -1
  95. data/lib/hubspot/version.rb +1 -1
  96. data/spec/discovery/base_api_client_spec.rb +8 -8
  97. metadata +68 -16
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Tasks
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 Tasks
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::Tasks::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::Tasks::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::Tasks.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
@@ -21,26 +21,26 @@ module Hubspot
21
21
  def initialize(api_client = ApiClient.default)
22
22
  @api_client = api_client
23
23
  end
24
- # Remove an association between two products
25
- # @param product_id [String]
24
+ # Delete
25
+ # deletes all associations between two records.
26
+ # @param product_id [Integer]
26
27
  # @param to_object_type [String]
27
- # @param to_object_id [String]
28
- # @param association_type [String]
28
+ # @param to_object_id [Integer]
29
29
  # @param [Hash] opts the optional parameters
30
30
  # @return [nil]
31
- def archive(product_id, to_object_type, to_object_id, association_type, opts = {})
32
- archive_with_http_info(product_id, to_object_type, to_object_id, association_type, opts)
31
+ def archive(product_id, to_object_type, to_object_id, opts = {})
32
+ archive_with_http_info(product_id, to_object_type, to_object_id, opts)
33
33
  nil
34
34
  end
35
35
 
36
- # Remove an association between two products
37
- # @param product_id [String]
36
+ # Delete
37
+ # deletes all associations between two records.
38
+ # @param product_id [Integer]
38
39
  # @param to_object_type [String]
39
- # @param to_object_id [String]
40
- # @param association_type [String]
40
+ # @param to_object_id [Integer]
41
41
  # @param [Hash] opts the optional parameters
42
42
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
43
- def archive_with_http_info(product_id, to_object_type, to_object_id, association_type, opts = {})
43
+ def archive_with_http_info(product_id, to_object_type, to_object_id, opts = {})
44
44
  if @api_client.config.debugging
45
45
  @api_client.config.logger.debug 'Calling API: AssociationsApi.archive ...'
46
46
  end
@@ -56,12 +56,8 @@ module Hubspot
56
56
  if @api_client.config.client_side_validation && to_object_id.nil?
57
57
  fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.archive"
58
58
  end
59
- # verify the required parameter 'association_type' is set
60
- if @api_client.config.client_side_validation && association_type.nil?
61
- fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.archive"
62
- end
63
59
  # resource path
64
- local_var_path = '/crm/v4/objects/products/{productId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'productId' + '}', CGI.escape(product_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))
60
+ local_var_path = '/crm/v4/objects/products/{productId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'productId' + '}', CGI.escape(product_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
65
61
 
66
62
  # query parameters
67
63
  query_params = opts[:query_params] || {}
@@ -100,26 +96,28 @@ module Hubspot
100
96
  return data, status_code, headers
101
97
  end
102
98
 
103
- # Associate a product with another object
104
- # @param product_id [String]
99
+ # Create
100
+ # Set association labels between two records.
101
+ # @param product_id [Integer]
105
102
  # @param to_object_type [String]
106
- # @param to_object_id [String]
107
- # @param association_type [String]
103
+ # @param to_object_id [Integer]
104
+ # @param association_spec [Array<AssociationSpec>]
108
105
  # @param [Hash] opts the optional parameters
109
- # @return [SimplePublicObjectWithAssociations]
110
- def create(product_id, to_object_type, to_object_id, association_type, opts = {})
111
- data, _status_code, _headers = create_with_http_info(product_id, to_object_type, to_object_id, association_type, opts)
106
+ # @return [LabelsBetweenObjectPair]
107
+ def create(product_id, to_object_type, to_object_id, association_spec, opts = {})
108
+ data, _status_code, _headers = create_with_http_info(product_id, to_object_type, to_object_id, association_spec, opts)
112
109
  data
113
110
  end
114
111
 
115
- # Associate a product with another object
116
- # @param product_id [String]
112
+ # Create
113
+ # Set association labels between two records.
114
+ # @param product_id [Integer]
117
115
  # @param to_object_type [String]
118
- # @param to_object_id [String]
119
- # @param association_type [String]
116
+ # @param to_object_id [Integer]
117
+ # @param association_spec [Array<AssociationSpec>]
120
118
  # @param [Hash] opts the optional parameters
121
- # @return [Array<(SimplePublicObjectWithAssociations, Integer, Hash)>] SimplePublicObjectWithAssociations data, response status code and response headers
122
- def create_with_http_info(product_id, to_object_type, to_object_id, association_type, opts = {})
119
+ # @return [Array<(LabelsBetweenObjectPair, Integer, Hash)>] LabelsBetweenObjectPair data, response status code and response headers
120
+ def create_with_http_info(product_id, to_object_type, to_object_id, association_spec, opts = {})
123
121
  if @api_client.config.debugging
124
122
  @api_client.config.logger.debug 'Calling API: AssociationsApi.create ...'
125
123
  end
@@ -135,12 +133,12 @@ module Hubspot
135
133
  if @api_client.config.client_side_validation && to_object_id.nil?
136
134
  fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.create"
137
135
  end
138
- # verify the required parameter 'association_type' is set
139
- if @api_client.config.client_side_validation && association_type.nil?
140
- fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.create"
136
+ # verify the required parameter 'association_spec' is set
137
+ if @api_client.config.client_side_validation && association_spec.nil?
138
+ fail ArgumentError, "Missing the required parameter 'association_spec' when calling AssociationsApi.create"
141
139
  end
142
140
  # resource path
143
- local_var_path = '/crm/v4/objects/products/{productId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'productId' + '}', CGI.escape(product_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))
141
+ local_var_path = '/crm/v4/objects/products/{productId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'productId' + '}', CGI.escape(product_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
144
142
 
145
143
  # query parameters
146
144
  query_params = opts[:query_params] || {}
@@ -149,15 +147,20 @@ module Hubspot
149
147
  header_params = opts[:header_params] || {}
150
148
  # HTTP header 'Accept' (if needed)
151
149
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
150
+ # HTTP header 'Content-Type'
151
+ content_type = @api_client.select_header_content_type(['application/json'])
152
+ if !content_type.nil?
153
+ header_params['Content-Type'] = content_type
154
+ end
152
155
 
153
156
  # form parameters
154
157
  form_params = opts[:form_params] || {}
155
158
 
156
159
  # http body (model)
157
- post_body = opts[:debug_body]
160
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(association_spec)
158
161
 
159
162
  # return_type
160
- return_type = opts[:debug_return_type] || 'SimplePublicObjectWithAssociations'
163
+ return_type = opts[:debug_return_type] || 'LabelsBetweenObjectPair'
161
164
 
162
165
  # auth_names
163
166
  auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
@@ -179,25 +182,27 @@ module Hubspot
179
182
  return data, status_code, headers
180
183
  end
181
184
 
182
- # List associations of a product by type
183
- # @param product_id [String]
185
+ # List
186
+ # List all associations of a product by object type. Limit 1000 per call.
187
+ # @param product_id [Integer]
184
188
  # @param to_object_type [String]
185
189
  # @param [Hash] opts the optional parameters
186
190
  # @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.
187
191
  # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
188
- # @return [CollectionResponseAssociatedIdForwardPaging]
192
+ # @return [CollectionResponseMultiAssociatedObjectWithLabelForwardPaging]
189
193
  def get_all(product_id, to_object_type, opts = {})
190
194
  data, _status_code, _headers = get_all_with_http_info(product_id, to_object_type, opts)
191
195
  data
192
196
  end
193
197
 
194
- # List associations of a product by type
195
- # @param product_id [String]
198
+ # List
199
+ # List all associations of a product by object type. Limit 1000 per call.
200
+ # @param product_id [Integer]
196
201
  # @param to_object_type [String]
197
202
  # @param [Hash] opts the optional parameters
198
203
  # @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.
199
204
  # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
200
- # @return [Array<(CollectionResponseAssociatedIdForwardPaging, Integer, Hash)>] CollectionResponseAssociatedIdForwardPaging data, response status code and response headers
205
+ # @return [Array<(CollectionResponseMultiAssociatedObjectWithLabelForwardPaging, Integer, Hash)>] CollectionResponseMultiAssociatedObjectWithLabelForwardPaging data, response status code and response headers
201
206
  def get_all_with_http_info(product_id, to_object_type, opts = {})
202
207
  if @api_client.config.debugging
203
208
  @api_client.config.logger.debug 'Calling API: AssociationsApi.get_all ...'
@@ -230,7 +235,7 @@ module Hubspot
230
235
  post_body = opts[:debug_body]
231
236
 
232
237
  # return_type
233
- return_type = opts[:debug_return_type] || 'CollectionResponseAssociatedIdForwardPaging'
238
+ return_type = opts[:debug_return_type] || 'CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'
234
239
 
235
240
  # auth_names
236
241
  auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']