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