hubspot-api-client 16.2.0 → 16.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/hubspot/codegen/automation/actions/models/action_function.rb +1 -0
  5. data/lib/hubspot/codegen/automation/actions/models/action_function_identifier.rb +1 -0
  6. data/lib/hubspot/codegen/automation/actions/models/action_labels.rb +1 -0
  7. data/lib/hubspot/codegen/automation/actions/models/action_revision.rb +1 -0
  8. data/lib/hubspot/codegen/automation/actions/models/callback_completion_batch_request.rb +1 -0
  9. data/lib/hubspot/codegen/automation/actions/models/callback_completion_request.rb +1 -0
  10. data/lib/hubspot/codegen/automation/actions/models/extension_action_definition.rb +1 -0
  11. data/lib/hubspot/codegen/automation/actions/models/extension_action_definition_input.rb +1 -0
  12. data/lib/hubspot/codegen/automation/actions/models/extension_action_definition_patch.rb +1 -0
  13. data/lib/hubspot/codegen/automation/actions/models/extension_action_definition_patch_input_field_dependencies_inner.rb +1 -0
  14. data/lib/hubspot/codegen/automation/actions/models/field_type_definition.rb +1 -0
  15. data/lib/hubspot/codegen/automation/actions/models/input_field_definition.rb +1 -0
  16. data/lib/hubspot/codegen/automation/actions/models/object_request_options.rb +1 -0
  17. data/lib/hubspot/codegen/automation/actions/models/option.rb +1 -0
  18. data/lib/hubspot/codegen/cms/blogs/authors/models/attach_to_lang_primary_request_v_next.rb +1 -0
  19. data/lib/hubspot/codegen/cms/blogs/authors/models/batch_input_blog_author.rb +1 -0
  20. data/lib/hubspot/codegen/cms/blogs/authors/models/batch_input_json_node.rb +1 -0
  21. data/lib/hubspot/codegen/cms/blogs/authors/models/batch_input_string.rb +1 -0
  22. data/lib/hubspot/codegen/cms/blogs/authors/models/batch_response_blog_author.rb +1 -0
  23. data/lib/hubspot/codegen/cms/blogs/authors/models/batch_response_blog_author_with_errors.rb +1 -0
  24. data/lib/hubspot/codegen/cms/blogs/authors/models/blog_author.rb +1 -0
  25. data/lib/hubspot/codegen/cms/blogs/authors/models/blog_author_clone_request_v_next.rb +1 -0
  26. data/lib/hubspot/codegen/cms/blogs/authors/models/collection_response_with_total_blog_author_forward_paging.rb +1 -0
  27. data/lib/hubspot/codegen/cms/blogs/authors/models/detach_from_lang_group_request_v_next.rb +1 -0
  28. data/lib/hubspot/codegen/cms/blogs/authors/models/forward_paging.rb +1 -0
  29. data/lib/hubspot/codegen/cms/blogs/authors/models/next_page.rb +1 -0
  30. data/lib/hubspot/codegen/cms/blogs/authors/models/set_new_language_primary_request_v_next.rb +1 -0
  31. data/lib/hubspot/codegen/cms/blogs/authors/models/standard_error.rb +1 -0
  32. data/lib/hubspot/codegen/cms/blogs/authors/models/update_languages_request_v_next.rb +1 -0
  33. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/attach_to_lang_primary_request_v_next.rb +1 -0
  34. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/batch_input_blog_post.rb +1 -0
  35. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/batch_input_json_node.rb +1 -0
  36. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/batch_input_string.rb +1 -0
  37. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/batch_response_blog_post.rb +1 -0
  38. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/batch_response_blog_post_with_errors.rb +1 -0
  39. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb +1 -0
  40. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post_language_clone_request_v_next.rb +1 -0
  41. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/collection_response_with_total_blog_post_forward_paging.rb +1 -0
  42. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/collection_response_with_total_version_blog_post.rb +1 -0
  43. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/content_clone_request_v_next.rb +1 -0
  44. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/content_schedule_request_v_next.rb +1 -0
  45. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/detach_from_lang_group_request_v_next.rb +1 -0
  46. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/forward_paging.rb +1 -0
  47. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/next_page.rb +1 -0
  48. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/paging.rb +1 -0
  49. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/previous_page.rb +1 -0
  50. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/rgba_color.rb +1 -0
  51. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/set_new_language_primary_request_v_next.rb +1 -0
  52. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/standard_error.rb +1 -0
  53. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/update_languages_request_v_next.rb +1 -0
  54. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/version_blog_post.rb +1 -0
  55. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/version_user.rb +1 -0
  56. data/lib/hubspot/codegen/cms/blogs/tags/models/attach_to_lang_primary_request_v_next.rb +1 -0
  57. data/lib/hubspot/codegen/cms/blogs/tags/models/batch_input_json_node.rb +1 -0
  58. data/lib/hubspot/codegen/cms/blogs/tags/models/batch_input_string.rb +1 -0
  59. data/lib/hubspot/codegen/cms/blogs/tags/models/batch_input_tag.rb +1 -0
  60. data/lib/hubspot/codegen/cms/blogs/tags/models/batch_response_tag.rb +1 -0
  61. data/lib/hubspot/codegen/cms/blogs/tags/models/batch_response_tag_with_errors.rb +1 -0
  62. data/lib/hubspot/codegen/cms/blogs/tags/models/collection_response_with_total_tag_forward_paging.rb +1 -0
  63. data/lib/hubspot/codegen/cms/blogs/tags/models/detach_from_lang_group_request_v_next.rb +1 -0
  64. data/lib/hubspot/codegen/cms/blogs/tags/models/forward_paging.rb +1 -0
  65. data/lib/hubspot/codegen/cms/blogs/tags/models/next_page.rb +1 -0
  66. data/lib/hubspot/codegen/cms/blogs/tags/models/set_new_language_primary_request_v_next.rb +1 -0
  67. data/lib/hubspot/codegen/cms/blogs/tags/models/standard_error.rb +1 -0
  68. data/lib/hubspot/codegen/cms/blogs/tags/models/tag.rb +1 -0
  69. data/lib/hubspot/codegen/cms/blogs/tags/models/tag_clone_request_v_next.rb +1 -0
  70. data/lib/hubspot/codegen/cms/blogs/tags/models/update_languages_request_v_next.rb +1 -0
  71. data/lib/hubspot/codegen/conversations/visitor-identification/models/identification_token_generation_request.rb +1 -0
  72. data/lib/hubspot/codegen/conversations/visitor-identification/models/identification_token_response.rb +1 -0
  73. data/lib/hubspot/codegen/crm/associations/api/batch_api.rb +30 -18
  74. data/lib/hubspot/codegen/crm/associations/api/types_api.rb +3 -3
  75. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association.rb +29 -38
  76. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association_multi.rb +29 -38
  77. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association_multi_with_errors.rb +346 -0
  78. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association_with_errors.rb +346 -0
  79. data/lib/hubspot/codegen/crm/associations/models/collection_response_public_association_definition_no_paging.rb +230 -0
  80. data/lib/hubspot/codegen/crm/associations/models/error_category.rb +20 -20
  81. data/lib/hubspot/codegen/crm/associations/models/paging.rb +13 -4
  82. data/lib/hubspot/codegen/crm/associations/models/previous_page.rb +237 -0
  83. data/lib/hubspot/codegen/crm/associations/models/public_association_definition.rb +242 -0
  84. data/lib/hubspot/codegen/crm/associations/models/public_association_multi.rb +13 -4
  85. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_app_settings.rb +1 -0
  86. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_app_urls.rb +1 -0
  87. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_customer.rb +1 -0
  88. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_invoice.rb +1 -0
  89. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_term.rb +1 -0
  90. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_features.rb +1 -0
  91. data/lib/hubspot/codegen/crm/extensions/accounting/models/address.rb +1 -0
  92. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_invoice_feature.rb +1 -0
  93. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_invoice_sub_features.rb +1 -0
  94. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_user_account_request_external.rb +1 -0
  95. data/lib/hubspot/codegen/crm/extensions/accounting/models/customer_search_response_external.rb +1 -0
  96. data/lib/hubspot/codegen/crm/extensions/accounting/models/exchange_rate_response.rb +1 -0
  97. data/lib/hubspot/codegen/crm/extensions/accounting/models/import_invoice_feature.rb +1 -0
  98. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_pdf_response.rb +1 -0
  99. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_read_response.rb +1 -0
  100. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_search_response.rb +1 -0
  101. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_update_request.rb +1 -0
  102. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoices_response_external.rb +1 -0
  103. data/lib/hubspot/codegen/crm/extensions/accounting/models/product.rb +1 -0
  104. data/lib/hubspot/codegen/crm/extensions/accounting/models/product_search_response.rb +1 -0
  105. data/lib/hubspot/codegen/crm/extensions/accounting/models/result_id_accounting_response.rb +1 -0
  106. data/lib/hubspot/codegen/crm/extensions/accounting/models/sync_contacts_request.rb +1 -0
  107. data/lib/hubspot/codegen/crm/extensions/accounting/models/sync_products_request.rb +1 -0
  108. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax.rb +1 -0
  109. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax_search_response.rb +1 -0
  110. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax_type.rb +1 -0
  111. data/lib/hubspot/codegen/crm/extensions/accounting/models/terms_response.rb +1 -0
  112. data/lib/hubspot/codegen/crm/extensions/accounting/models/unit_price.rb +1 -0
  113. data/lib/hubspot/codegen/crm/extensions/accounting/models/updated_contact.rb +1 -0
  114. data/lib/hubspot/codegen/crm/extensions/accounting/models/updated_product.rb +1 -0
  115. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_patch_request.rb +1 -0
  116. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_request.rb +1 -0
  117. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_response.rb +1 -0
  118. data/lib/hubspot/codegen/crm/extensions/cards/models/card_actions.rb +1 -0
  119. data/lib/hubspot/codegen/crm/extensions/cards/models/card_create_request.rb +1 -0
  120. data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_body.rb +1 -0
  121. data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_property.rb +1 -0
  122. data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body.rb +1 -0
  123. data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body_patch.rb +1 -0
  124. data/lib/hubspot/codegen/crm/extensions/cards/models/card_list_response.rb +1 -0
  125. data/lib/hubspot/codegen/crm/extensions/cards/models/card_patch_request.rb +1 -0
  126. data/lib/hubspot/codegen/crm/extensions/cards/models/card_response.rb +1 -0
  127. data/lib/hubspot/codegen/crm/extensions/cards/models/display_option.rb +1 -0
  128. data/lib/hubspot/codegen/crm/extensions/cards/models/integrator_card_payload_response.rb +1 -0
  129. data/lib/hubspot/codegen/crm/extensions/cards/models/integrator_object_result_actions_inner.rb +1 -0
  130. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/external_settings.rb +1 -0
  131. data/lib/hubspot/codegen/files/files/models/collection_response_file.rb +1 -0
  132. data/lib/hubspot/codegen/files/files/models/file_update_input.rb +1 -0
  133. data/lib/hubspot/codegen/files/files/models/folder_input.rb +1 -0
  134. data/lib/hubspot/codegen/files/files/models/folder_update_input.rb +1 -0
  135. data/lib/hubspot/codegen/files/files/models/folder_update_task_locator.rb +1 -0
  136. data/lib/hubspot/codegen/files/files/models/hubspot_file.rb +1 -0
  137. data/lib/hubspot/codegen/files/files/models/import_from_url_task_locator.rb +1 -0
  138. data/lib/hubspot/codegen/marketing/events/api/marketing_events_external_api.rb +0 -60
  139. data/lib/hubspot/codegen/marketing/events/api/search_api.rb +90 -0
  140. data/lib/hubspot/codegen/marketing/events/models/batch_input_marketing_event_email_subscriber.rb +1 -0
  141. data/lib/hubspot/codegen/marketing/events/models/batch_input_marketing_event_subscriber.rb +1 -0
  142. data/lib/hubspot/codegen/marketing/events/models/property_value.rb +13 -4
  143. data/lib/hubspot/codegen/marketing/forms/models/collection_response_form_definition_base_forward_paging_results_inner.rb +1 -0
  144. data/lib/hubspot/codegen/marketing/forms/models/datepicker_field.rb +1 -0
  145. data/lib/hubspot/codegen/marketing/forms/models/dependent_field.rb +1 -0
  146. data/lib/hubspot/codegen/marketing/forms/models/dependent_field_dependent_field.rb +1 -0
  147. data/lib/hubspot/codegen/marketing/forms/models/dependent_field_filter.rb +1 -0
  148. data/lib/hubspot/codegen/marketing/forms/models/dropdown_field.rb +1 -0
  149. data/lib/hubspot/codegen/marketing/forms/models/email_field.rb +1 -0
  150. data/lib/hubspot/codegen/marketing/forms/models/email_field_validation.rb +1 -0
  151. data/lib/hubspot/codegen/marketing/forms/models/field_group.rb +1 -0
  152. data/lib/hubspot/codegen/marketing/forms/models/file_field.rb +1 -0
  153. data/lib/hubspot/codegen/marketing/forms/models/form_definition_base.rb +1 -0
  154. data/lib/hubspot/codegen/marketing/forms/models/form_definition_create_request_base.rb +1 -0
  155. data/lib/hubspot/codegen/marketing/forms/models/form_display_options.rb +1 -0
  156. data/lib/hubspot/codegen/marketing/forms/models/form_post_submit_action.rb +1 -0
  157. data/lib/hubspot/codegen/marketing/forms/models/form_style.rb +1 -0
  158. data/lib/hubspot/codegen/marketing/forms/models/hub_spot_form_definition_patch_request_legal_consent_options.rb +1 -0
  159. data/lib/hubspot/codegen/marketing/forms/models/mobile_phone_field.rb +1 -0
  160. data/lib/hubspot/codegen/marketing/forms/models/multi_line_text_field.rb +1 -0
  161. data/lib/hubspot/codegen/marketing/forms/models/multiple_checkboxes_field.rb +1 -0
  162. data/lib/hubspot/codegen/marketing/forms/models/number_field.rb +1 -0
  163. data/lib/hubspot/codegen/marketing/forms/models/number_field_validation.rb +1 -0
  164. data/lib/hubspot/codegen/marketing/forms/models/phone_field.rb +1 -0
  165. data/lib/hubspot/codegen/marketing/forms/models/phone_field_validation.rb +1 -0
  166. data/lib/hubspot/codegen/marketing/forms/models/radio_field.rb +1 -0
  167. data/lib/hubspot/codegen/marketing/forms/models/single_checkbox_field.rb +1 -0
  168. data/lib/hubspot/codegen/marketing/forms/models/single_line_text_field.rb +1 -0
  169. data/lib/hubspot/codegen/marketing/transactional/models/email_send_status_view.rb +1 -0
  170. data/lib/hubspot/codegen/marketing/transactional/models/event_id_view.rb +1 -0
  171. data/lib/hubspot/codegen/marketing/transactional/models/public_single_send_email.rb +1 -0
  172. data/lib/hubspot/codegen/marketing/transactional/models/public_single_send_request_egg.rb +1 -0
  173. data/lib/hubspot/codegen/marketing/transactional/models/smtp_api_token_request_egg.rb +1 -0
  174. data/lib/hubspot/codegen/marketing/transactional/models/smtp_api_token_view.rb +1 -0
  175. data/lib/hubspot/codegen/settings/users/models/public_permission_set.rb +1 -0
  176. data/lib/hubspot/codegen/settings/users/models/public_team.rb +1 -0
  177. data/lib/hubspot/codegen/settings/users/models/public_user.rb +1 -0
  178. data/lib/hubspot/codegen/settings/users/models/public_user_update.rb +1 -0
  179. data/lib/hubspot/codegen/settings/users/models/user_provision_request.rb +1 -0
  180. data/lib/hubspot/discovery/marketing/events/api/search_api.rb +13 -0
  181. data/lib/hubspot/discovery/marketing/events/client.rb +1 -0
  182. data/lib/hubspot/version.rb +1 -1
  183. data/spec/discovery/marketing/events/marketing_events_external_api_spec.rb +0 -1
  184. data/spec/discovery/marketing/events/search_api_spec.rb +7 -0
  185. metadata +12 -3
@@ -0,0 +1,346 @@
1
+ =begin
2
+ #Associations
3
+
4
+ #Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations.
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 Associations
19
+ class BatchResponsePublicAssociationMultiWithErrors
20
+ attr_accessor :status
21
+
22
+ attr_accessor :results
23
+
24
+ attr_accessor :num_errors
25
+
26
+ attr_accessor :errors
27
+
28
+ attr_accessor :requested_at
29
+
30
+ attr_accessor :started_at
31
+
32
+ attr_accessor :completed_at
33
+
34
+ attr_accessor :links
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'status' => :'status',
62
+ :'results' => :'results',
63
+ :'num_errors' => :'numErrors',
64
+ :'errors' => :'errors',
65
+ :'requested_at' => :'requestedAt',
66
+ :'started_at' => :'startedAt',
67
+ :'completed_at' => :'completedAt',
68
+ :'links' => :'links'
69
+ }
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'status' => :'String',
81
+ :'results' => :'Array<PublicAssociationMulti>',
82
+ :'num_errors' => :'Integer',
83
+ :'errors' => :'Array<StandardError>',
84
+ :'requested_at' => :'Time',
85
+ :'started_at' => :'Time',
86
+ :'completed_at' => :'Time',
87
+ :'links' => :'Hash<String, String>'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Associations::BatchResponsePublicAssociationMultiWithErrors` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!self.class.attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Associations::BatchResponsePublicAssociationMultiWithErrors`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'status')
113
+ self.status = attributes[:'status']
114
+ end
115
+
116
+ if attributes.key?(:'results')
117
+ if (value = attributes[:'results']).is_a?(Array)
118
+ self.results = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'num_errors')
123
+ self.num_errors = attributes[:'num_errors']
124
+ end
125
+
126
+ if attributes.key?(:'errors')
127
+ if (value = attributes[:'errors']).is_a?(Array)
128
+ self.errors = value
129
+ end
130
+ end
131
+
132
+ if attributes.key?(:'requested_at')
133
+ self.requested_at = attributes[:'requested_at']
134
+ end
135
+
136
+ if attributes.key?(:'started_at')
137
+ self.started_at = attributes[:'started_at']
138
+ end
139
+
140
+ if attributes.key?(:'completed_at')
141
+ self.completed_at = attributes[:'completed_at']
142
+ end
143
+
144
+ if attributes.key?(:'links')
145
+ if (value = attributes[:'links']).is_a?(Hash)
146
+ self.links = value
147
+ end
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+ if @status.nil?
156
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
157
+ end
158
+
159
+ if @results.nil?
160
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
161
+ end
162
+
163
+ if @started_at.nil?
164
+ invalid_properties.push('invalid value for "started_at", started_at cannot be nil.')
165
+ end
166
+
167
+ if @completed_at.nil?
168
+ invalid_properties.push('invalid value for "completed_at", completed_at cannot be nil.')
169
+ end
170
+
171
+ invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ return false if @status.nil?
178
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"])
179
+ return false unless status_validator.valid?(@status)
180
+ return false if @results.nil?
181
+ return false if @started_at.nil?
182
+ return false if @completed_at.nil?
183
+ true
184
+ end
185
+
186
+ # Custom attribute writer method checking allowed values (enum).
187
+ # @param [Object] status Object to be assigned
188
+ def status=(status)
189
+ validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"])
190
+ unless validator.valid?(status)
191
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
192
+ end
193
+ @status = status
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ status == o.status &&
202
+ results == o.results &&
203
+ num_errors == o.num_errors &&
204
+ errors == o.errors &&
205
+ requested_at == o.requested_at &&
206
+ started_at == o.started_at &&
207
+ completed_at == o.completed_at &&
208
+ links == o.links
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [status, results, num_errors, errors, requested_at, started_at, completed_at, links].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ new.build_from_hash(attributes)
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ attributes = attributes.transform_keys(&:to_sym)
236
+ self.class.openapi_types.each_pair do |key, type|
237
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
238
+ self.send("#{key}=", nil)
239
+ elsif type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
244
+ end
245
+ elsif !attributes[self.class.attribute_map[key]].nil?
246
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
247
+ end
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :Time
260
+ Time.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :Boolean
270
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ # models (e.g. Pet) or oneOf
291
+ klass = Hubspot::Crm::Associations.const_get(type)
292
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
293
+ end
294
+ end
295
+
296
+ # Returns the string representation of the object
297
+ # @return [String] String presentation of the object
298
+ def to_s
299
+ to_hash.to_s
300
+ end
301
+
302
+ # to_body is an alias to to_hash (backward compatibility)
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_body
305
+ to_hash
306
+ end
307
+
308
+ # Returns the object in the form of hash
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_hash
311
+ hash = {}
312
+ self.class.attribute_map.each_pair do |attr, param|
313
+ value = self.send(attr)
314
+ if value.nil?
315
+ is_nullable = self.class.openapi_nullable.include?(attr)
316
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
+ end
318
+
319
+ hash[param] = _to_hash(value)
320
+ end
321
+ hash
322
+ end
323
+
324
+ # Outputs non-array value in the form of hash
325
+ # For object, use to_hash. Otherwise, just return the value
326
+ # @param [Object] value Any valid value
327
+ # @return [Hash] Returns the value in the form of hash
328
+ def _to_hash(value)
329
+ if value.is_a?(Array)
330
+ value.compact.map { |v| _to_hash(v) }
331
+ elsif value.is_a?(Hash)
332
+ {}.tap do |hash|
333
+ value.each { |k, v| hash[k] = _to_hash(v) }
334
+ end
335
+ elsif value.respond_to? :to_hash
336
+ value.to_hash
337
+ else
338
+ value
339
+ end
340
+ end
341
+
342
+ end
343
+
344
+ end
345
+ end
346
+ end
@@ -0,0 +1,346 @@
1
+ =begin
2
+ #Associations
3
+
4
+ #Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations.
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 Associations
19
+ class BatchResponsePublicAssociationWithErrors
20
+ attr_accessor :status
21
+
22
+ attr_accessor :results
23
+
24
+ attr_accessor :num_errors
25
+
26
+ attr_accessor :errors
27
+
28
+ attr_accessor :requested_at
29
+
30
+ attr_accessor :started_at
31
+
32
+ attr_accessor :completed_at
33
+
34
+ attr_accessor :links
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'status' => :'status',
62
+ :'results' => :'results',
63
+ :'num_errors' => :'numErrors',
64
+ :'errors' => :'errors',
65
+ :'requested_at' => :'requestedAt',
66
+ :'started_at' => :'startedAt',
67
+ :'completed_at' => :'completedAt',
68
+ :'links' => :'links'
69
+ }
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'status' => :'String',
81
+ :'results' => :'Array<PublicAssociation>',
82
+ :'num_errors' => :'Integer',
83
+ :'errors' => :'Array<StandardError>',
84
+ :'requested_at' => :'Time',
85
+ :'started_at' => :'Time',
86
+ :'completed_at' => :'Time',
87
+ :'links' => :'Hash<String, String>'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Associations::BatchResponsePublicAssociationWithErrors` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!self.class.attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Associations::BatchResponsePublicAssociationWithErrors`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'status')
113
+ self.status = attributes[:'status']
114
+ end
115
+
116
+ if attributes.key?(:'results')
117
+ if (value = attributes[:'results']).is_a?(Array)
118
+ self.results = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'num_errors')
123
+ self.num_errors = attributes[:'num_errors']
124
+ end
125
+
126
+ if attributes.key?(:'errors')
127
+ if (value = attributes[:'errors']).is_a?(Array)
128
+ self.errors = value
129
+ end
130
+ end
131
+
132
+ if attributes.key?(:'requested_at')
133
+ self.requested_at = attributes[:'requested_at']
134
+ end
135
+
136
+ if attributes.key?(:'started_at')
137
+ self.started_at = attributes[:'started_at']
138
+ end
139
+
140
+ if attributes.key?(:'completed_at')
141
+ self.completed_at = attributes[:'completed_at']
142
+ end
143
+
144
+ if attributes.key?(:'links')
145
+ if (value = attributes[:'links']).is_a?(Hash)
146
+ self.links = value
147
+ end
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+ if @status.nil?
156
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
157
+ end
158
+
159
+ if @results.nil?
160
+ invalid_properties.push('invalid value for "results", results cannot be nil.')
161
+ end
162
+
163
+ if @started_at.nil?
164
+ invalid_properties.push('invalid value for "started_at", started_at cannot be nil.')
165
+ end
166
+
167
+ if @completed_at.nil?
168
+ invalid_properties.push('invalid value for "completed_at", completed_at cannot be nil.')
169
+ end
170
+
171
+ invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ return false if @status.nil?
178
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"])
179
+ return false unless status_validator.valid?(@status)
180
+ return false if @results.nil?
181
+ return false if @started_at.nil?
182
+ return false if @completed_at.nil?
183
+ true
184
+ end
185
+
186
+ # Custom attribute writer method checking allowed values (enum).
187
+ # @param [Object] status Object to be assigned
188
+ def status=(status)
189
+ validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"])
190
+ unless validator.valid?(status)
191
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
192
+ end
193
+ @status = status
194
+ end
195
+
196
+ # Checks equality by comparing each attribute.
197
+ # @param [Object] Object to be compared
198
+ def ==(o)
199
+ return true if self.equal?(o)
200
+ self.class == o.class &&
201
+ status == o.status &&
202
+ results == o.results &&
203
+ num_errors == o.num_errors &&
204
+ errors == o.errors &&
205
+ requested_at == o.requested_at &&
206
+ started_at == o.started_at &&
207
+ completed_at == o.completed_at &&
208
+ links == o.links
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [status, results, num_errors, errors, requested_at, started_at, completed_at, links].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ new.build_from_hash(attributes)
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ attributes = attributes.transform_keys(&:to_sym)
236
+ self.class.openapi_types.each_pair do |key, type|
237
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
238
+ self.send("#{key}=", nil)
239
+ elsif type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
244
+ end
245
+ elsif !attributes[self.class.attribute_map[key]].nil?
246
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
247
+ end
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :Time
260
+ Time.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :Boolean
270
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ # models (e.g. Pet) or oneOf
291
+ klass = Hubspot::Crm::Associations.const_get(type)
292
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
293
+ end
294
+ end
295
+
296
+ # Returns the string representation of the object
297
+ # @return [String] String presentation of the object
298
+ def to_s
299
+ to_hash.to_s
300
+ end
301
+
302
+ # to_body is an alias to to_hash (backward compatibility)
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_body
305
+ to_hash
306
+ end
307
+
308
+ # Returns the object in the form of hash
309
+ # @return [Hash] Returns the object in the form of hash
310
+ def to_hash
311
+ hash = {}
312
+ self.class.attribute_map.each_pair do |attr, param|
313
+ value = self.send(attr)
314
+ if value.nil?
315
+ is_nullable = self.class.openapi_nullable.include?(attr)
316
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
317
+ end
318
+
319
+ hash[param] = _to_hash(value)
320
+ end
321
+ hash
322
+ end
323
+
324
+ # Outputs non-array value in the form of hash
325
+ # For object, use to_hash. Otherwise, just return the value
326
+ # @param [Object] value Any valid value
327
+ # @return [Hash] Returns the value in the form of hash
328
+ def _to_hash(value)
329
+ if value.is_a?(Array)
330
+ value.compact.map { |v| _to_hash(v) }
331
+ elsif value.is_a?(Hash)
332
+ {}.tap do |hash|
333
+ value.each { |k, v| hash[k] = _to_hash(v) }
334
+ end
335
+ elsif value.respond_to? :to_hash
336
+ value.to_hash
337
+ else
338
+ value
339
+ end
340
+ end
341
+
342
+ end
343
+
344
+ end
345
+ end
346
+ end