hubspot-api-client 16.2.1 → 16.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -1
  3. data/Gemfile.lock +1 -1
  4. data/README.md +33 -1
  5. data/lib/hubspot/codegen/crm/associations/v4/api/batch_api.rb +428 -0
  6. data/lib/hubspot/codegen/crm/associations/v4/api/definitions_api.rb +332 -0
  7. data/lib/hubspot/codegen/crm/associations/v4/api_client.rb +412 -0
  8. data/lib/hubspot/codegen/crm/associations/v4/api_error.rb +63 -0
  9. data/lib/hubspot/codegen/crm/associations/v4/configuration.rb +296 -0
  10. data/lib/hubspot/codegen/crm/associations/v4/models/association_spec.rb +278 -0
  11. data/lib/hubspot/codegen/crm/associations/v4/models/association_spec_with_label.rb +287 -0
  12. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_archive.rb +232 -0
  13. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_post.rb +232 -0
  14. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_default_association_multi_post.rb +232 -0
  15. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_fetch_associations_batch_request.rb +232 -0
  16. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair.rb +328 -0
  17. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair_with_errors.rb +348 -0
  18. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label.rb +328 -0
  19. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label_with_errors.rb +348 -0
  20. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_default_association.rb +348 -0
  21. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_association_spec_with_label_no_paging.rb +232 -0
  22. data/lib/hubspot/codegen/crm/associations/v4/models/error.rb +307 -0
  23. data/lib/hubspot/codegen/crm/associations/v4/models/error_category.rb +278 -0
  24. data/lib/hubspot/codegen/crm/associations/v4/models/error_detail.rb +273 -0
  25. data/lib/hubspot/codegen/crm/associations/v4/models/labels_between_object_pair.rb +288 -0
  26. data/lib/hubspot/codegen/crm/associations/v4/models/multi_associated_object_with_label.rb +246 -0
  27. data/lib/hubspot/codegen/crm/associations/v4/models/next_page.rb +239 -0
  28. data/lib/hubspot/codegen/crm/associations/v4/models/paging.rb +234 -0
  29. data/lib/hubspot/codegen/crm/associations/v4/models/previous_page.rb +239 -0
  30. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_create_request.rb +244 -0
  31. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_update_request.rb +244 -0
  32. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_archive.rb +246 -0
  33. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_post.rb +260 -0
  34. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_with_label.rb +255 -0
  35. data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association.rb +258 -0
  36. data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association_multi_post.rb +244 -0
  37. data/lib/hubspot/codegen/crm/associations/v4/models/public_fetch_associations_batch_request.rb +239 -0
  38. data/lib/hubspot/codegen/crm/associations/v4/models/public_object_id.rb +230 -0
  39. data/lib/hubspot/codegen/crm/associations/v4/models/standard_error.rb +324 -0
  40. data/lib/hubspot/codegen/crm/properties/models/property.rb +14 -4
  41. data/lib/hubspot/codegen/crm/properties/models/property_create.rb +38 -8
  42. data/lib/hubspot/codegen/crm/properties/models/property_update.rb +18 -8
  43. data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +0 -2
  44. data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +5 -7
  45. data/lib/hubspot/codegen/oauth/api/tokens_api.rb +0 -2
  46. data/lib/hubspot/codegen/oauth/api_client.rb +0 -2
  47. data/lib/hubspot/codegen/oauth/api_error.rb +0 -2
  48. data/lib/hubspot/codegen/oauth/configuration.rb +0 -2
  49. data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +0 -2
  50. data/lib/hubspot/codegen/oauth/models/error.rb +0 -2
  51. data/lib/hubspot/codegen/oauth/models/error_detail.rb +0 -2
  52. data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +0 -2
  53. data/lib/hubspot/codegen/oauth/models/token_response_if.rb +31 -33
  54. data/lib/hubspot/discovery/crm/associations/client.rb +3 -1
  55. data/lib/hubspot/discovery/crm/associations/v4/api/batch_api.rb +15 -0
  56. data/lib/hubspot/discovery/crm/associations/v4/api/definitions_api.rb +15 -0
  57. data/lib/hubspot/discovery/crm/associations/v4/client.rb +21 -0
  58. data/lib/hubspot/helpers/get_all_helper.rb +2 -1
  59. data/lib/hubspot/version.rb +1 -1
  60. data/spec/discovery/cms/blogs/client_spec.rb +9 -0
  61. data/spec/discovery/cms/client_spec.rb +13 -0
  62. data/spec/discovery/crm/associations/client_spec.rb +7 -0
  63. data/spec/discovery/crm/associations/v4/batch_api_spec.rb +11 -0
  64. data/spec/discovery/crm/associations/v4/definitions_api_spec.rb +10 -0
  65. data/spec/discovery/crm/client_spec.rb +21 -0
  66. data/spec/discovery/crm/extensions/client_spec.rb +11 -0
  67. data/spec/discovery/crm/objects/client_spec.rb +13 -0
  68. data/spec/discovery/marketing/client_spec.rb +9 -0
  69. metadata +58 -2
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #CrmPublicAssociationsServiceV4
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v4
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 Associations
19
+ module V4
20
+ class Paging
21
+ attr_accessor :_next
22
+
23
+ attr_accessor :prev
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'_next' => :'next',
29
+ :'prev' => :'prev'
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
+ :'_next' => :'NextPage',
42
+ :'prev' => :'PreviousPage'
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::Associations::V4::Paging` 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::Associations::V4::Paging`. 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?(:'_next')
68
+ self._next = attributes[:'_next']
69
+ end
70
+
71
+ if attributes.key?(:'prev')
72
+ self.prev = attributes[:'prev']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ _next == o._next &&
95
+ prev == o.prev
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ def hash
107
+ [_next, prev].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def self.build_from_hash(attributes)
114
+ new.build_from_hash(attributes)
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
+ self.send("#{key}=", nil)
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = Hubspot::Crm::Associations::V4.const_get(type)
179
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end
232
+ end
233
+ end
234
+ end
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #CrmPublicAssociationsServiceV4
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v4
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 Associations
19
+ module V4
20
+ class PreviousPage
21
+ attr_accessor :before
22
+
23
+ attr_accessor :link
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'before' => :'before',
29
+ :'link' => :'link'
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
+ :'before' => :'String',
42
+ :'link' => :'String'
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::Associations::V4::PreviousPage` 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::Associations::V4::PreviousPage`. 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?(:'before')
68
+ self.before = attributes[:'before']
69
+ end
70
+
71
+ if attributes.key?(:'link')
72
+ self.link = attributes[:'link']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ if @before.nil?
81
+ invalid_properties.push('invalid value for "before", before cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ return false if @before.nil?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ before == o.before &&
100
+ link == o.link
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [before, link].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ self.class.openapi_types.each_pair do |key, type|
129
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
+ self.send("#{key}=", nil)
131
+ elsif type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :Time
152
+ Time.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ # models (e.g. Pet) or oneOf
183
+ klass = Hubspot::Crm::Associations::V4.const_get(type)
184
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+
236
+ end
237
+ end
238
+ end
239
+ end