hubspot-api-client 9.4.0 → 10.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (376) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/Gemfile.lock +4 -4
  4. data/LICENSE +201 -0
  5. data/README.md +1 -1
  6. data/hubspot-api-client.gemspec +1 -1
  7. data/lib/hubspot/codegen/automation/actions/api_client.rb +14 -0
  8. data/lib/hubspot/codegen/cms/audit-logs/api_client.rb +14 -0
  9. data/lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb +2 -2
  10. data/lib/hubspot/codegen/cms/blogs/authors/api_client.rb +14 -0
  11. data/lib/hubspot/codegen/cms/blogs/blog-posts/api/default_api.rb +2 -2
  12. data/lib/hubspot/codegen/cms/blogs/blog-posts/api_client.rb +14 -0
  13. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb +108 -102
  14. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/layout_section.rb +4 -2
  15. data/lib/hubspot/codegen/cms/blogs/tags/api/default_api.rb +2 -2
  16. data/lib/hubspot/codegen/cms/blogs/tags/api_client.rb +14 -0
  17. data/lib/hubspot/codegen/cms/domains/api_client.rb +14 -0
  18. data/lib/hubspot/codegen/cms/hubdb/api/rows_api.rb +1 -1
  19. data/lib/hubspot/codegen/cms/hubdb/api/rows_batch_api.rb +1 -1
  20. data/lib/hubspot/codegen/cms/hubdb/api/tables_api.rb +1 -1
  21. data/lib/hubspot/codegen/cms/hubdb/api_client.rb +15 -1
  22. data/lib/hubspot/codegen/cms/hubdb/api_error.rb +1 -1
  23. data/lib/hubspot/codegen/cms/hubdb/configuration.rb +1 -1
  24. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_hub_db_table_row_v3.rb +1 -1
  25. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_json_node.rb +1 -1
  26. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_string.rb +1 -1
  27. data/lib/hubspot/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors.rb +1 -1
  28. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging.rb +1 -1
  29. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging.rb +1 -1
  30. data/lib/hubspot/codegen/cms/hubdb/models/column.rb +1 -1
  31. data/lib/hubspot/codegen/cms/hubdb/models/column_input.rb +1 -1
  32. data/lib/hubspot/codegen/cms/hubdb/models/error.rb +1 -1
  33. data/lib/hubspot/codegen/cms/hubdb/models/error_detail.rb +1 -1
  34. data/lib/hubspot/codegen/cms/hubdb/models/foreign_id.rb +1 -1
  35. data/lib/hubspot/codegen/cms/hubdb/models/forward_paging.rb +1 -1
  36. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_clone_request.rb +1 -1
  37. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3.rb +5 -3
  38. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3_input.rb +1 -1
  39. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3.rb +1 -1
  40. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_input.rb +1 -1
  41. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_live_input.rb +1 -1
  42. data/lib/hubspot/codegen/cms/hubdb/models/import_result.rb +1 -1
  43. data/lib/hubspot/codegen/cms/hubdb/models/next_page.rb +1 -1
  44. data/lib/hubspot/codegen/cms/hubdb/models/option.rb +1 -1
  45. data/lib/hubspot/codegen/cms/hubdb/models/simple_user.rb +1 -1
  46. data/lib/hubspot/codegen/cms/hubdb/models/standard_error.rb +1 -1
  47. data/lib/hubspot/codegen/cms/performance/api_client.rb +14 -0
  48. data/lib/hubspot/codegen/cms/site-search/api/default_api.rb +2 -5
  49. data/lib/hubspot/codegen/cms/site-search/api_client.rb +14 -0
  50. data/lib/hubspot/codegen/cms/site-search/models/content_search_result.rb +19 -2
  51. data/lib/hubspot/codegen/cms/site-search/models/indexed_data.rb +5 -2
  52. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +17 -15
  53. data/lib/hubspot/codegen/cms/url-redirects/api_client.rb +14 -0
  54. data/lib/hubspot/codegen/conversations/visitor-identification/api/generate_api.rb +90 -0
  55. data/lib/hubspot/codegen/conversations/visitor-identification/api_client.rb +406 -0
  56. data/lib/hubspot/codegen/conversations/visitor-identification/api_error.rb +61 -0
  57. data/lib/hubspot/codegen/conversations/visitor-identification/configuration.rb +263 -0
  58. data/lib/hubspot/codegen/conversations/visitor-identification/models/error.rb +292 -0
  59. data/lib/hubspot/codegen/conversations/visitor-identification/models/error_detail.rb +258 -0
  60. data/lib/hubspot/codegen/conversations/visitor-identification/models/identification_token_generation_request.rb +236 -0
  61. data/lib/hubspot/codegen/{crm/schemas/models/next_page.rb → conversations/visitor-identification/models/identification_token_response.rb} +18 -27
  62. data/lib/hubspot/codegen/crm/associations/api_client.rb +14 -0
  63. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +6 -12
  64. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +11 -14
  65. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +3 -3
  66. data/lib/hubspot/codegen/crm/companies/api_client.rb +14 -0
  67. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +20 -20
  68. data/lib/hubspot/codegen/crm/companies/models/collection_response_associated_id_forward_paging.rb +226 -0
  69. data/lib/hubspot/codegen/crm/companies/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  70. data/lib/hubspot/codegen/crm/companies/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  71. data/lib/hubspot/codegen/crm/companies/models/forward_paging.rb +210 -0
  72. data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +1 -12
  73. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_with_associations.rb +288 -0
  74. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +6 -12
  75. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +11 -14
  76. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +3 -3
  77. data/lib/hubspot/codegen/crm/contacts/api_client.rb +14 -0
  78. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +20 -20
  79. data/lib/hubspot/codegen/crm/contacts/models/collection_response_associated_id_forward_paging.rb +226 -0
  80. data/lib/hubspot/codegen/crm/contacts/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  81. data/lib/hubspot/codegen/crm/contacts/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  82. data/lib/hubspot/codegen/crm/contacts/models/forward_paging.rb +210 -0
  83. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +1 -12
  84. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_with_associations.rb +288 -0
  85. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +6 -12
  86. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +11 -14
  87. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +3 -3
  88. data/lib/hubspot/codegen/crm/deals/api_client.rb +14 -0
  89. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +20 -20
  90. data/lib/hubspot/codegen/crm/deals/models/collection_response_associated_id_forward_paging.rb +226 -0
  91. data/lib/hubspot/codegen/crm/deals/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  92. data/lib/hubspot/codegen/crm/deals/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  93. data/lib/hubspot/codegen/crm/deals/models/forward_paging.rb +210 -0
  94. data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +1 -12
  95. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_with_associations.rb +288 -0
  96. data/lib/hubspot/codegen/crm/extensions/accounting/api_client.rb +14 -0
  97. data/lib/hubspot/codegen/crm/extensions/calling/api/settings_api.rb +24 -16
  98. data/lib/hubspot/codegen/crm/extensions/calling/api_client.rb +14 -0
  99. data/lib/hubspot/codegen/crm/extensions/calling/configuration.rb +1 -1
  100. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_patch_request.rb +14 -4
  101. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_request.rb +14 -4
  102. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_response.rb +16 -1
  103. data/lib/hubspot/codegen/crm/extensions/cards/api/cards_api.rb +25 -17
  104. data/lib/hubspot/codegen/crm/extensions/cards/api_client.rb +14 -0
  105. data/lib/hubspot/codegen/crm/extensions/cards/configuration.rb +1 -1
  106. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_client.rb +14 -0
  107. data/lib/hubspot/codegen/crm/imports/api/default_api.rb +90 -0
  108. data/lib/hubspot/codegen/crm/imports/api_client.rb +14 -0
  109. data/lib/hubspot/codegen/crm/imports/models/collection_response_public_import_error_forward_paging.rb +226 -0
  110. data/lib/hubspot/codegen/crm/{schemas/models/paging.rb → imports/models/forward_paging.rb} +11 -20
  111. data/lib/hubspot/codegen/crm/imports/models/import_row_core.rb +238 -0
  112. data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +353 -0
  113. data/lib/hubspot/codegen/crm/imports/models/public_import_response.rb +2 -2
  114. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +6 -12
  115. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +11 -14
  116. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +3 -3
  117. data/lib/hubspot/codegen/crm/line_items/api_client.rb +14 -0
  118. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +20 -20
  119. data/lib/hubspot/codegen/crm/line_items/models/collection_response_associated_id_forward_paging.rb +226 -0
  120. data/lib/hubspot/codegen/crm/line_items/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  121. data/lib/hubspot/codegen/crm/line_items/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  122. data/lib/hubspot/codegen/crm/line_items/models/forward_paging.rb +210 -0
  123. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object.rb +1 -12
  124. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_with_associations.rb +288 -0
  125. data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +6 -12
  126. data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +11 -14
  127. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +10 -10
  128. data/lib/hubspot/codegen/crm/objects/api_client.rb +14 -0
  129. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +3 -6
  130. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +6 -12
  131. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +3 -3
  132. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_client.rb +14 -0
  133. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.rb +20 -20
  134. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/{collection_response_simple_public_object.rb → collection_response_associated_id_forward_paging.rb} +5 -5
  135. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_simple_public_object_with_associations_forward_paging.rb +228 -0
  136. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  137. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/forward_paging.rb +212 -0
  138. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object.rb +1 -12
  139. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations.rb +290 -0
  140. data/lib/hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id.rb +20 -20
  141. data/lib/hubspot/codegen/crm/objects/models/collection_response_associated_id_forward_paging.rb +226 -0
  142. data/lib/hubspot/codegen/crm/objects/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  143. data/lib/hubspot/codegen/crm/objects/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  144. data/lib/hubspot/codegen/crm/objects/models/forward_paging.rb +210 -0
  145. data/lib/hubspot/codegen/crm/objects/models/simple_public_object.rb +1 -12
  146. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_with_associations.rb +288 -0
  147. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +9 -3
  148. data/lib/hubspot/codegen/crm/owners/api_client.rb +14 -0
  149. data/lib/hubspot/codegen/crm/owners/models/{collection_response_public_owner.rb → collection_response_public_owner_forward_paging.rb} +4 -4
  150. data/lib/hubspot/codegen/crm/owners/models/{paging.rb → forward_paging.rb} +3 -3
  151. data/lib/hubspot/codegen/crm/pipelines/api_client.rb +14 -0
  152. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +6 -12
  153. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +11 -14
  154. data/lib/hubspot/codegen/crm/products/api/search_api.rb +3 -3
  155. data/lib/hubspot/codegen/crm/products/api_client.rb +14 -0
  156. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +20 -20
  157. data/lib/hubspot/codegen/crm/products/models/collection_response_associated_id_forward_paging.rb +226 -0
  158. data/lib/hubspot/codegen/crm/products/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  159. data/lib/hubspot/codegen/crm/products/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  160. data/lib/hubspot/codegen/crm/products/models/forward_paging.rb +210 -0
  161. data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +1 -12
  162. data/lib/hubspot/codegen/crm/products/models/simple_public_object_with_associations.rb +288 -0
  163. data/lib/hubspot/codegen/crm/properties/api_client.rb +14 -0
  164. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +3 -6
  165. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +6 -12
  166. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +3 -3
  167. data/lib/hubspot/codegen/crm/quotes/api_client.rb +14 -0
  168. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +20 -20
  169. data/lib/hubspot/codegen/crm/quotes/models/collection_response_associated_id_forward_paging.rb +226 -0
  170. data/lib/hubspot/codegen/crm/quotes/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  171. data/lib/hubspot/codegen/crm/quotes/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  172. data/lib/hubspot/codegen/crm/{schemas/models/previous_page.rb → quotes/models/forward_paging.rb} +14 -28
  173. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object.rb +1 -12
  174. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_with_associations.rb +288 -0
  175. data/lib/hubspot/codegen/crm/schemas/api/core_api.rb +23 -17
  176. data/lib/hubspot/codegen/crm/schemas/api_client.rb +14 -0
  177. data/lib/hubspot/codegen/crm/schemas/models/association_definition.rb +1 -75
  178. data/lib/hubspot/codegen/crm/schemas/models/association_definition_egg.rb +4 -78
  179. data/lib/hubspot/codegen/crm/schemas/models/{collection_response_object_schema.rb → collection_response_object_schema_no_paging.rb} +7 -16
  180. data/lib/hubspot/codegen/crm/schemas/models/object_schema.rb +15 -1
  181. data/lib/hubspot/codegen/crm/schemas/models/object_type_definition.rb +15 -1
  182. data/lib/hubspot/codegen/crm/schemas/models/object_type_property_create.rb +2 -2
  183. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +6 -12
  184. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +11 -14
  185. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +3 -3
  186. data/lib/hubspot/codegen/crm/tickets/api_client.rb +14 -0
  187. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +20 -20
  188. data/lib/hubspot/codegen/crm/tickets/models/collection_response_associated_id_forward_paging.rb +226 -0
  189. data/lib/hubspot/codegen/crm/tickets/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  190. data/lib/hubspot/codegen/crm/tickets/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  191. data/lib/hubspot/codegen/crm/tickets/models/forward_paging.rb +210 -0
  192. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +1 -12
  193. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_with_associations.rb +288 -0
  194. data/lib/hubspot/codegen/crm/timeline/api_client.rb +14 -0
  195. data/lib/hubspot/codegen/events/api/events_api.rb +105 -0
  196. data/lib/hubspot/codegen/events/api_client.rb +404 -0
  197. data/lib/hubspot/codegen/events/api_error.rb +59 -0
  198. data/lib/hubspot/codegen/events/configuration.rb +261 -0
  199. data/lib/hubspot/codegen/events/models/collection_response_external_unified_event.rb +224 -0
  200. data/lib/hubspot/codegen/events/models/error.rb +290 -0
  201. data/lib/hubspot/codegen/events/models/error_detail.rb +256 -0
  202. data/lib/hubspot/codegen/events/models/external_unified_event.rb +290 -0
  203. data/lib/hubspot/codegen/events/models/next_page.rb +222 -0
  204. data/lib/hubspot/codegen/events/models/paging.rb +208 -0
  205. data/lib/hubspot/codegen/files/files/api/files_api.rb +8 -8
  206. data/lib/hubspot/codegen/files/files/api_client.rb +14 -0
  207. data/lib/hubspot/codegen/files/files/models/file_update_input.rb +2 -2
  208. data/lib/hubspot/codegen/files/files/models/{file.rb → hubspot_file.rb} +3 -3
  209. data/lib/hubspot/codegen/files/files/models/import_from_url_input.rb +2 -2
  210. data/lib/hubspot/codegen/marketing/transactional/api/default_api.rb +60 -60
  211. data/lib/hubspot/codegen/marketing/transactional/api_client.rb +14 -0
  212. data/lib/hubspot/codegen/oauth/api_client.rb +14 -0
  213. data/lib/hubspot/codegen/webhooks/api_client.rb +14 -0
  214. data/lib/hubspot/version.rb +1 -1
  215. data/spec/codegen/cms/blogs/authors/api/default_api_spec.rb +24 -24
  216. data/spec/codegen/cms/blogs/blog-posts/api/default_api_spec.rb +26 -26
  217. data/spec/codegen/cms/blogs/blog-posts/models/blog_post_spec.rb +14 -14
  218. data/spec/codegen/cms/blogs/tags/api/default_api_spec.rb +24 -24
  219. data/spec/codegen/cms/hubdb/api/rows_api_spec.rb +1 -1
  220. data/spec/codegen/cms/hubdb/api/rows_batch_api_spec.rb +1 -1
  221. data/spec/codegen/cms/hubdb/api/tables_api_spec.rb +1 -1
  222. data/spec/codegen/cms/hubdb/models/batch_input_hub_db_table_row_v3_spec.rb +1 -1
  223. data/spec/codegen/cms/hubdb/models/batch_input_json_node_spec.rb +1 -1
  224. data/spec/codegen/cms/hubdb/models/batch_input_string_spec.rb +1 -1
  225. data/spec/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors_spec.rb +1 -1
  226. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging_spec.rb +1 -1
  227. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging_spec.rb +1 -1
  228. data/spec/codegen/cms/hubdb/models/column_input_spec.rb +1 -1
  229. data/spec/codegen/cms/hubdb/models/column_spec.rb +1 -1
  230. data/spec/codegen/cms/hubdb/models/error_detail_spec.rb +1 -1
  231. data/spec/codegen/cms/hubdb/models/error_spec.rb +1 -1
  232. data/spec/codegen/cms/hubdb/models/foreign_id_spec.rb +1 -1
  233. data/spec/codegen/cms/hubdb/models/forward_paging_spec.rb +1 -1
  234. data/spec/codegen/cms/hubdb/models/hub_db_table_clone_request_spec.rb +1 -1
  235. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_input_spec.rb +1 -1
  236. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_spec.rb +1 -1
  237. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_input_spec.rb +1 -1
  238. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_live_input_spec.rb +1 -1
  239. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_spec.rb +1 -1
  240. data/spec/codegen/cms/hubdb/models/import_result_spec.rb +1 -1
  241. data/spec/codegen/cms/hubdb/models/next_page_spec.rb +1 -1
  242. data/spec/codegen/cms/hubdb/models/option_spec.rb +1 -1
  243. data/spec/codegen/cms/hubdb/models/simple_user_spec.rb +1 -1
  244. data/spec/codegen/cms/hubdb/models/standard_error_spec.rb +1 -1
  245. data/spec/codegen/cms/site-search/api/default_api_spec.rb +0 -1
  246. data/spec/codegen/cms/site-search/models/content_search_result_spec.rb +1 -1
  247. data/spec/codegen/cms/site-search/models/indexed_data_spec.rb +1 -1
  248. data/spec/codegen/cms/site-search/models/search_hit_field_spec.rb +2 -2
  249. data/spec/codegen/conversations/visitor-identification/api/generate_api_spec.rb +47 -0
  250. data/spec/codegen/conversations/visitor-identification/models/error_detail_spec.rb +65 -0
  251. data/spec/codegen/conversations/visitor-identification/models/error_spec.rb +77 -0
  252. data/spec/codegen/conversations/visitor-identification/models/identification_token_generation_request_spec.rb +53 -0
  253. data/spec/codegen/conversations/visitor-identification/models/identification_token_response_spec.rb +41 -0
  254. data/spec/codegen/crm/companies/api/associations_api_spec.rb +2 -4
  255. data/spec/codegen/crm/companies/api/basic_api_spec.rb +4 -5
  256. data/spec/codegen/crm/companies/api/search_api_spec.rb +1 -1
  257. data/spec/codegen/crm/companies/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  258. data/spec/codegen/crm/companies/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  259. data/spec/codegen/crm/companies/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  260. data/spec/codegen/crm/companies/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  261. data/spec/codegen/crm/companies/models/forward_paging_spec.rb +41 -0
  262. data/spec/codegen/crm/companies/models/simple_public_object_spec.rb +0 -6
  263. data/spec/codegen/crm/companies/models/simple_public_object_with_associations_spec.rb +77 -0
  264. data/spec/codegen/crm/contacts/api/associations_api_spec.rb +2 -4
  265. data/spec/codegen/crm/contacts/api/basic_api_spec.rb +4 -5
  266. data/spec/codegen/crm/contacts/api/search_api_spec.rb +1 -1
  267. data/spec/codegen/crm/contacts/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  268. data/spec/codegen/crm/contacts/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  269. data/spec/codegen/crm/contacts/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  270. data/spec/codegen/crm/contacts/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  271. data/spec/codegen/crm/contacts/models/forward_paging_spec.rb +41 -0
  272. data/spec/codegen/crm/contacts/models/simple_public_object_spec.rb +0 -6
  273. data/spec/codegen/crm/contacts/models/simple_public_object_with_associations_spec.rb +77 -0
  274. data/spec/codegen/crm/deals/api/associations_api_spec.rb +2 -4
  275. data/spec/codegen/crm/deals/api/basic_api_spec.rb +4 -5
  276. data/spec/codegen/crm/deals/api/search_api_spec.rb +1 -1
  277. data/spec/codegen/crm/deals/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  278. data/spec/codegen/crm/deals/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  279. data/spec/codegen/crm/deals/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  280. data/spec/codegen/crm/deals/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  281. data/spec/codegen/crm/deals/models/forward_paging_spec.rb +41 -0
  282. data/spec/codegen/crm/deals/models/simple_public_object_spec.rb +0 -6
  283. data/spec/codegen/crm/deals/models/simple_public_object_with_associations_spec.rb +77 -0
  284. data/spec/codegen/crm/imports/api/default_api_spec.rb +47 -0
  285. data/spec/codegen/crm/imports/models/collection_response_public_import_error_forward_paging_spec.rb +47 -0
  286. data/spec/codegen/crm/imports/models/forward_paging_spec.rb +41 -0
  287. data/spec/codegen/crm/imports/models/import_row_core_spec.rb +53 -0
  288. data/spec/codegen/crm/imports/models/public_import_error_spec.rb +97 -0
  289. data/spec/codegen/crm/imports/models/public_import_response_spec.rb +1 -1
  290. data/spec/codegen/crm/line_items/api/associations_api_spec.rb +2 -4
  291. data/spec/codegen/crm/line_items/api/basic_api_spec.rb +4 -5
  292. data/spec/codegen/crm/line_items/api/search_api_spec.rb +1 -1
  293. data/spec/codegen/crm/line_items/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  294. data/spec/codegen/crm/line_items/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  295. data/spec/codegen/crm/line_items/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  296. data/spec/codegen/crm/line_items/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  297. data/spec/codegen/crm/line_items/models/forward_paging_spec.rb +41 -0
  298. data/spec/codegen/crm/line_items/models/simple_public_object_spec.rb +0 -6
  299. data/spec/codegen/crm/line_items/models/simple_public_object_with_associations_spec.rb +77 -0
  300. data/spec/codegen/crm/objects/api/associations_api_spec.rb +2 -4
  301. data/spec/codegen/crm/objects/api/basic_api_spec.rb +4 -5
  302. data/spec/codegen/crm/objects/api/search_api_spec.rb +3 -3
  303. data/spec/codegen/crm/objects/feedback_submissions/api/associations_api_spec.rb +1 -2
  304. data/spec/codegen/crm/objects/feedback_submissions/api/basic_api_spec.rb +2 -4
  305. data/spec/codegen/crm/objects/feedback_submissions/api/search_api_spec.rb +1 -1
  306. data/spec/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  307. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  308. data/spec/codegen/crm/objects/feedback_submissions/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  309. data/spec/codegen/crm/objects/feedback_submissions/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  310. data/spec/codegen/crm/objects/feedback_submissions/models/forward_paging_spec.rb +41 -0
  311. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_spec.rb +0 -6
  312. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations_spec.rb +77 -0
  313. data/spec/codegen/crm/objects/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  314. data/spec/codegen/crm/objects/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  315. data/spec/codegen/crm/objects/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  316. data/spec/codegen/crm/objects/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  317. data/spec/codegen/crm/objects/models/forward_paging_spec.rb +41 -0
  318. data/spec/codegen/crm/objects/models/simple_public_object_spec.rb +0 -6
  319. data/spec/codegen/crm/objects/models/simple_public_object_with_associations_spec.rb +77 -0
  320. data/spec/codegen/crm/owners/api/default_api_spec.rb +3 -1
  321. data/spec/codegen/crm/owners/models/{collection_response_public_owner_spec.rb → collection_response_public_owner_forward_paging_spec.rb} +6 -6
  322. data/spec/codegen/crm/owners/models/{paging_spec.rb → forward_paging_spec.rb} +6 -6
  323. data/spec/codegen/crm/products/api/associations_api_spec.rb +2 -4
  324. data/spec/codegen/crm/products/api/basic_api_spec.rb +4 -5
  325. data/spec/codegen/crm/products/api/search_api_spec.rb +1 -1
  326. data/spec/codegen/crm/products/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  327. data/spec/codegen/crm/products/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  328. data/spec/codegen/crm/products/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  329. data/spec/codegen/crm/products/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  330. data/spec/codegen/crm/products/models/forward_paging_spec.rb +41 -0
  331. data/spec/codegen/crm/products/models/simple_public_object_spec.rb +0 -6
  332. data/spec/codegen/crm/products/models/simple_public_object_with_associations_spec.rb +77 -0
  333. data/spec/codegen/crm/quotes/api/associations_api_spec.rb +1 -2
  334. data/spec/codegen/crm/quotes/api/basic_api_spec.rb +2 -4
  335. data/spec/codegen/crm/quotes/api/search_api_spec.rb +1 -1
  336. data/spec/codegen/crm/quotes/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  337. data/spec/codegen/crm/quotes/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  338. data/spec/codegen/crm/quotes/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  339. data/spec/codegen/crm/quotes/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  340. data/spec/codegen/crm/quotes/models/forward_paging_spec.rb +41 -0
  341. data/spec/codegen/crm/quotes/models/simple_public_object_spec.rb +0 -6
  342. data/spec/codegen/crm/quotes/models/simple_public_object_with_associations_spec.rb +77 -0
  343. data/spec/codegen/crm/schemas/api/core_api_spec.rb +10 -8
  344. data/spec/codegen/crm/schemas/models/association_definition_egg_spec.rb +0 -20
  345. data/spec/codegen/crm/schemas/models/association_definition_spec.rb +0 -20
  346. data/spec/codegen/crm/schemas/models/{collection_response_object_schema_spec.rb → collection_response_object_schema_no_paging_spec.rb} +6 -12
  347. data/spec/codegen/crm/schemas/models/object_schema_spec.rb +6 -0
  348. data/spec/codegen/crm/schemas/models/object_type_definition_spec.rb +6 -0
  349. data/spec/codegen/crm/schemas/models/object_type_property_create_spec.rb +1 -1
  350. data/spec/codegen/crm/tickets/api/associations_api_spec.rb +2 -4
  351. data/spec/codegen/crm/tickets/api/basic_api_spec.rb +4 -5
  352. data/spec/codegen/crm/tickets/api/search_api_spec.rb +1 -1
  353. data/spec/codegen/crm/tickets/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  354. data/spec/codegen/crm/tickets/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  355. data/spec/codegen/crm/tickets/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  356. data/spec/codegen/crm/tickets/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  357. data/spec/codegen/crm/tickets/models/forward_paging_spec.rb +41 -0
  358. data/spec/codegen/crm/tickets/models/simple_public_object_spec.rb +0 -6
  359. data/spec/codegen/crm/tickets/models/simple_public_object_with_associations_spec.rb +77 -0
  360. data/spec/codegen/events/api/events_api_spec.rb +54 -0
  361. data/spec/codegen/events/models/collection_response_external_unified_event_spec.rb +47 -0
  362. data/spec/codegen/events/models/error_detail_spec.rb +65 -0
  363. data/spec/codegen/events/models/error_spec.rb +77 -0
  364. data/spec/codegen/events/models/external_unified_event_spec.rb +71 -0
  365. data/spec/codegen/{crm/schemas → events}/models/next_page_spec.rb +5 -5
  366. data/spec/codegen/{crm/schemas → events}/models/paging_spec.rb +5 -11
  367. data/spec/codegen/files/files/api/files_api_spec.rb +2 -2
  368. data/spec/codegen/files/files/models/file_update_input_spec.rb +1 -1
  369. data/spec/codegen/files/files/models/{file_spec.rb → hubspot_file_spec.rb} +5 -5
  370. data/spec/codegen/files/files/models/import_from_url_input_spec.rb +1 -1
  371. data/spec/codegen/marketing/transactional/api/default_api_spec.rb +12 -12
  372. data/spec/features/conversations/visitor-identification/generate_api_spec.rb +7 -0
  373. data/spec/features/crm/objects/search_api_spec.rb +1 -1
  374. data/spec/features/events/events_api_spec.rb +7 -0
  375. metadata +212 -78
  376. data/spec/codegen/crm/schemas/models/previous_page_spec.rb +0 -47
@@ -55,6 +55,20 @@ module Hubspot
55
55
  @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
56
56
  end
57
57
 
58
+ if !response.success? && config.error_handler.any?
59
+ config.error_handler.each do |statuses, opts|
60
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
61
+
62
+ retries = opts[:max_retries] || 5
63
+ while retries > 0 && statuses.include?(response.code)
64
+ sleep opts[:seconds_delay] if opts[:seconds_delay]
65
+ response = request.run
66
+ opts[:retry_block].call if opts[:retry_block]
67
+ retries -= 1
68
+ end
69
+ end
70
+ end
71
+
58
72
  unless response.success?
59
73
  if response.timed_out?
60
74
  fail ApiError.new('Connection timed out')
@@ -16,38 +16,55 @@ module Hubspot
16
16
  module Cms
17
17
  module SiteSearch
18
18
  class ContentSearchResult
19
+ # The ID of the content.
19
20
  attr_accessor :id
20
21
 
22
+ # The matching score of the document.
21
23
  attr_accessor :score
22
24
 
25
+ # The type of document. Can be `SITE_PAGE`, `LANDING_PAGE`, `BLOG_POST`, `LISTING_PAGE`, or `KNOWLEDGE_ARTICLE`.
23
26
  attr_accessor :type
24
27
 
28
+ # The domain the document is hosted on.
25
29
  attr_accessor :domain
26
30
 
31
+ # The url of the document.
27
32
  attr_accessor :url
28
33
 
34
+ # URL of the featured image.
29
35
  attr_accessor :featured_image_url
30
36
 
37
+ # The document's language.
31
38
  attr_accessor :language
32
39
 
40
+ # The title of the returned document.
33
41
  attr_accessor :title
34
42
 
43
+ # The result's description. The content will be determined by the value of `length` in the request.
35
44
  attr_accessor :description
36
45
 
46
+ # For knowledge articles, the category of the article.
37
47
  attr_accessor :category
38
48
 
49
+ # For knowledge articles, the subcategory of the article.
39
50
  attr_accessor :subcategory
40
51
 
52
+ # Name of the author.
41
53
  attr_accessor :author_full_name
42
54
 
55
+ # If a blog post, the tags associated with it.
43
56
  attr_accessor :tags
44
57
 
58
+ # If a dynamic page, the ID of the HubDB table.
45
59
  attr_accessor :table_id
46
60
 
61
+ # If a dynamic page, the row ID in the HubDB table.
47
62
  attr_accessor :row_id
48
63
 
64
+ # The date the content was published.
49
65
  attr_accessor :published_date
50
66
 
67
+ # The ID of the document in HubSpot.
51
68
  attr_accessor :combined_id
52
69
 
53
70
  class EnumAttributeValidator
@@ -243,7 +260,7 @@ module Hubspot
243
260
  return false if @id.nil?
244
261
  return false if @score.nil?
245
262
  return false if @type.nil?
246
- type_validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "DOCUMENT", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
263
+ type_validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
247
264
  return false unless type_validator.valid?(@type)
248
265
  return false if @domain.nil?
249
266
  return false if @url.nil?
@@ -255,7 +272,7 @@ module Hubspot
255
272
  # Custom attribute writer method checking allowed values (enum).
256
273
  # @param [Object] type Object to be assigned
257
274
  def type=(type)
258
- validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "DOCUMENT", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
275
+ validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
259
276
  unless validator.valid?(type)
260
277
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
261
278
  end
@@ -16,10 +16,13 @@ module Hubspot
16
16
  module Cms
17
17
  module SiteSearch
18
18
  class IndexedData
19
+ # The ID of the document in HubSpot.
19
20
  attr_accessor :id
20
21
 
22
+ # The type of document. Can be `SITE_PAGE`, `LANDING_PAGE`, `BLOG_POST`, `LISTING_PAGE`, or `KNOWLEDGE_ARTICLE`.
21
23
  attr_accessor :type
22
24
 
25
+ # The indexed fields in HubSpot.
23
26
  attr_accessor :fields
24
27
 
25
28
  class EnumAttributeValidator
@@ -122,7 +125,7 @@ module Hubspot
122
125
  def valid?
123
126
  return false if @id.nil?
124
127
  return false if @type.nil?
125
- type_validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "DOCUMENT", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
128
+ type_validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
126
129
  return false unless type_validator.valid?(@type)
127
130
  return false if @fields.nil?
128
131
  true
@@ -131,7 +134,7 @@ module Hubspot
131
134
  # Custom attribute writer method checking allowed values (enum).
132
135
  # @param [Object] type Object to be assigned
133
136
  def type=(type)
134
- validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "DOCUMENT", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
137
+ validator = EnumAttributeValidator.new('String', ["LANDING_PAGE", "BLOG_POST", "SITE_PAGE", "KNOWLEDGE_ARTICLE", "LISTING_PAGE"])
135
138
  unless validator.valid?(type)
136
139
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
137
140
  end
@@ -16,10 +16,10 @@ module Hubspot
16
16
  module Cms
17
17
  module SiteSearch
18
18
  class SearchHitField
19
- attr_accessor :metadata_field
20
-
21
19
  attr_accessor :values
22
20
 
21
+ attr_accessor :metadata_field
22
+
23
23
  attr_accessor :name
24
24
 
25
25
  attr_accessor :value
@@ -27,8 +27,8 @@ module Hubspot
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
28
28
  def self.attribute_map
29
29
  {
30
- :'metadata_field' => :'metadataField',
31
30
  :'values' => :'values',
31
+ :'metadata_field' => :'metadataField',
32
32
  :'name' => :'name',
33
33
  :'value' => :'value'
34
34
  }
@@ -37,8 +37,8 @@ module Hubspot
37
37
  # Attribute type mapping.
38
38
  def self.openapi_types
39
39
  {
40
+ :'values' => :'Array<Object>',
40
41
  :'metadata_field' => :'Boolean',
41
- :'values' => :'Array',
42
42
  :'name' => :'String',
43
43
  :'value' => :'Object'
44
44
  }
@@ -65,12 +65,14 @@ module Hubspot
65
65
  h[k.to_sym] = v
66
66
  }
67
67
 
68
- if attributes.key?(:'metadata_field')
69
- self.metadata_field = attributes[:'metadata_field']
68
+ if attributes.key?(:'values')
69
+ if (value = attributes[:'values']).is_a?(Array)
70
+ self.values = value
71
+ end
70
72
  end
71
73
 
72
- if attributes.key?(:'values')
73
- self.values = attributes[:'values']
74
+ if attributes.key?(:'metadata_field')
75
+ self.metadata_field = attributes[:'metadata_field']
74
76
  end
75
77
 
76
78
  if attributes.key?(:'name')
@@ -86,14 +88,14 @@ module Hubspot
86
88
  # @return Array for valid properties with the reasons
87
89
  def list_invalid_properties
88
90
  invalid_properties = Array.new
89
- if @metadata_field.nil?
90
- invalid_properties.push('invalid value for "metadata_field", metadata_field cannot be nil.')
91
- end
92
-
93
91
  if @values.nil?
94
92
  invalid_properties.push('invalid value for "values", values cannot be nil.')
95
93
  end
96
94
 
95
+ if @metadata_field.nil?
96
+ invalid_properties.push('invalid value for "metadata_field", metadata_field cannot be nil.')
97
+ end
98
+
97
99
  if @name.nil?
98
100
  invalid_properties.push('invalid value for "name", name cannot be nil.')
99
101
  end
@@ -108,8 +110,8 @@ module Hubspot
108
110
  # Check to see if the all the properties in the model are valid
109
111
  # @return true if the model is valid
110
112
  def valid?
111
- return false if @metadata_field.nil?
112
113
  return false if @values.nil?
114
+ return false if @metadata_field.nil?
113
115
  return false if @name.nil?
114
116
  return false if @value.nil?
115
117
  true
@@ -120,8 +122,8 @@ module Hubspot
120
122
  def ==(o)
121
123
  return true if self.equal?(o)
122
124
  self.class == o.class &&
123
- metadata_field == o.metadata_field &&
124
125
  values == o.values &&
126
+ metadata_field == o.metadata_field &&
125
127
  name == o.name &&
126
128
  value == o.value
127
129
  end
@@ -135,7 +137,7 @@ module Hubspot
135
137
  # Calculates hash code according to all attributes.
136
138
  # @return [Integer] Hash code
137
139
  def hash
138
- [metadata_field, values, name, value].hash
140
+ [values, metadata_field, name, value].hash
139
141
  end
140
142
 
141
143
  # Builds the object from hash
@@ -55,6 +55,20 @@ module Hubspot
55
55
  @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
56
56
  end
57
57
 
58
+ if !response.success? && config.error_handler.any?
59
+ config.error_handler.each do |statuses, opts|
60
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
61
+
62
+ retries = opts[:max_retries] || 5
63
+ while retries > 0 && statuses.include?(response.code)
64
+ sleep opts[:seconds_delay] if opts[:seconds_delay]
65
+ response = request.run
66
+ opts[:retry_block].call if opts[:retry_block]
67
+ retries -= 1
68
+ end
69
+ end
70
+ end
71
+
58
72
  unless response.success?
59
73
  if response.timed_out?
60
74
  fail ApiError.new('Connection timed out')
@@ -0,0 +1,90 @@
1
+ =begin
2
+ #Visitor Identification
3
+
4
+ #The Visitor Identification API allows you to pass identification information to the HubSpot chat widget for otherwise unknown visitors that were verified by your own authentication system.
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Hubspot
16
+ module Conversations
17
+ module VisitorIdentification
18
+ class GenerateApi
19
+ attr_accessor :api_client
20
+
21
+ def initialize(api_client = ApiClient.default)
22
+ @api_client = api_client
23
+ end
24
+ # Generate a token
25
+ # Generates a new visitor identification token. This token will be unique every time this endpoint is called, even if called with the same email address. This token is temporary and will expire after 12 hours
26
+ # @param identification_token_generation_request [IdentificationTokenGenerationRequest]
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [IdentificationTokenResponse]
29
+ def generate_token(identification_token_generation_request, opts = {})
30
+ data, _status_code, _headers = generate_token_with_http_info(identification_token_generation_request, opts)
31
+ data
32
+ end
33
+
34
+ # Generate a token
35
+ # Generates a new visitor identification token. This token will be unique every time this endpoint is called, even if called with the same email address. This token is temporary and will expire after 12 hours
36
+ # @param identification_token_generation_request [IdentificationTokenGenerationRequest]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(IdentificationTokenResponse, Integer, Hash)>] IdentificationTokenResponse data, response status code and response headers
39
+ def generate_token_with_http_info(identification_token_generation_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: GenerateApi.generate_token ...'
42
+ end
43
+ # verify the required parameter 'identification_token_generation_request' is set
44
+ if @api_client.config.client_side_validation && identification_token_generation_request.nil?
45
+ fail ArgumentError, "Missing the required parameter 'identification_token_generation_request' when calling GenerateApi.generate_token"
46
+ end
47
+ # resource path
48
+ local_var_path = '/conversations/v3/visitor-identification/tokens/create'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
57
+ # HTTP header 'Content-Type'
58
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:body] || @api_client.object_to_http_body(identification_token_generation_request)
65
+
66
+ # return_type
67
+ return_type = opts[:return_type] || 'IdentificationTokenResponse'
68
+
69
+ # auth_names
70
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
71
+
72
+ new_options = opts.merge(
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: GenerateApi#generate_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,406 @@
1
+ =begin
2
+ #Visitor Identification
3
+
4
+ #The Visitor Identification API allows you to pass identification information to the HubSpot chat widget for otherwise unknown visitors that were verified by your own authentication system.
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'json'
15
+ require 'logger'
16
+ require 'tempfile'
17
+ require 'typhoeus'
18
+
19
+ module Hubspot
20
+ module Conversations
21
+ module VisitorIdentification
22
+ class ApiClient
23
+ # The Configuration object holding settings to be used in the API client.
24
+ attr_accessor :config
25
+
26
+ # Defines the headers to be used in HTTP requests of all API calls by default.
27
+ #
28
+ # @return [Hash]
29
+ attr_accessor :default_headers
30
+
31
+ # Initializes the ApiClient
32
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
33
+ def initialize(config = Configuration.default)
34
+ @config = config
35
+ @user_agent = "hubspot-api-client-ruby; #{VERSION}"
36
+ @default_headers = {
37
+ 'Content-Type' => 'application/json',
38
+ 'User-Agent' => @user_agent
39
+ }
40
+ end
41
+
42
+ def self.default
43
+ @@default ||= ApiClient.new
44
+ end
45
+
46
+ # Call an API with given options.
47
+ #
48
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
49
+ # the data deserialized from response body (could be nil), response status code and response headers.
50
+ def call_api(http_method, path, opts = {})
51
+ request = build_request(http_method, path, opts)
52
+ response = request.run
53
+
54
+ if @config.debugging
55
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
56
+ end
57
+
58
+ if !response.success? && config.error_handler.any?
59
+ config.error_handler.each do |statuses, opts|
60
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
61
+
62
+ retries = opts[:max_retries] || 5
63
+ while retries > 0 && statuses.include?(response.code)
64
+ sleep opts[:seconds_delay] if opts[:seconds_delay]
65
+ response = request.run
66
+ opts[:retry_block].call if opts[:retry_block]
67
+ retries -= 1
68
+ end
69
+ end
70
+ end
71
+
72
+ unless response.success?
73
+ if response.timed_out?
74
+ fail ApiError.new('Connection timed out')
75
+ elsif response.code == 0
76
+ # Errors from libcurl will be made visible here
77
+ fail ApiError.new(:code => 0,
78
+ :message => response.return_message)
79
+ else
80
+ fail ApiError.new(:code => response.code,
81
+ :response_headers => response.headers,
82
+ :response_body => response.body),
83
+ response.status_message
84
+ end
85
+ end
86
+
87
+ if opts[:return_type]
88
+ data = deserialize(response, opts[:return_type])
89
+ else
90
+ data = nil
91
+ end
92
+ return data, response.code, response.headers
93
+ end
94
+
95
+ # Builds the HTTP request
96
+ #
97
+ # @param [String] http_method HTTP method/verb (e.g. POST)
98
+ # @param [String] path URL path (e.g. /account/new)
99
+ # @option opts [Hash] :header_params Header parameters
100
+ # @option opts [Hash] :query_params Query parameters
101
+ # @option opts [Hash] :form_params Query parameters
102
+ # @option opts [Object] :body HTTP body (JSON/XML)
103
+ # @return [Typhoeus::Request] A Typhoeus Request
104
+ def build_request(http_method, path, opts = {})
105
+ url = build_request_url(path)
106
+ http_method = http_method.to_sym.downcase
107
+
108
+ header_params = @default_headers.merge(opts[:header_params] || {})
109
+ query_params = opts[:query_params] || {}
110
+ form_params = opts[:form_params] || {}
111
+
112
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
113
+
114
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
115
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
116
+
117
+ req_opts = {
118
+ :method => http_method,
119
+ :headers => header_params,
120
+ :params => query_params,
121
+ :params_encoding => @config.params_encoding,
122
+ :timeout => @config.timeout,
123
+ :ssl_verifypeer => @config.verify_ssl,
124
+ :ssl_verifyhost => _verify_ssl_host,
125
+ :sslcert => @config.cert_file,
126
+ :sslkey => @config.key_file,
127
+ :verbose => @config.debugging
128
+ }
129
+
130
+ # set custom cert, if provided
131
+ req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
132
+
133
+ if [:post, :patch, :put, :delete].include?(http_method)
134
+ req_body = build_request_body(header_params, form_params, opts[:body])
135
+ req_opts.update :body => req_body
136
+ if @config.debugging
137
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
138
+ end
139
+ end
140
+
141
+ request = Typhoeus::Request.new(url, req_opts)
142
+ download_file(request) if opts[:return_type] == 'File'
143
+ request
144
+ end
145
+
146
+ # Builds the HTTP request body
147
+ #
148
+ # @param [Hash] header_params Header parameters
149
+ # @param [Hash] form_params Query parameters
150
+ # @param [Object] body HTTP body (JSON/XML)
151
+ # @return [String] HTTP body data in the form of string
152
+ def build_request_body(header_params, form_params, body)
153
+ # http form
154
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
155
+ header_params['Content-Type'] == 'multipart/form-data'
156
+ data = {}
157
+ form_params.each do |key, value|
158
+ case value
159
+ when ::File, ::Array, nil
160
+ # let typhoeus handle File, Array and nil parameters
161
+ data[key] = value
162
+ else
163
+ data[key] = value.to_s
164
+ end
165
+ end
166
+ elsif body
167
+ data = body.is_a?(String) ? body : body.to_json
168
+ else
169
+ data = nil
170
+ end
171
+ data
172
+ end
173
+
174
+ # Check if the given MIME is a JSON MIME.
175
+ # JSON MIME examples:
176
+ # application/json
177
+ # application/json; charset=UTF8
178
+ # APPLICATION/JSON
179
+ # */*
180
+ # @param [String] mime MIME
181
+ # @return [Boolean] True if the MIME is application/json
182
+ def json_mime?(mime)
183
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
184
+ end
185
+
186
+ # Deserialize the response to the given return type.
187
+ #
188
+ # @param [Response] response HTTP response
189
+ # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
190
+ def deserialize(response, return_type)
191
+ body = response.body
192
+
193
+ # handle file downloading - return the File instance processed in request callbacks
194
+ # note that response body is empty when the file is written in chunks in request on_body callback
195
+ return @tempfile if return_type == 'File'
196
+
197
+ return nil if body.nil? || body.empty?
198
+
199
+ # return response body directly for String return type
200
+ return body if return_type == 'String'
201
+
202
+ # ensuring a default content type
203
+ content_type = response.headers['Content-Type'] || 'application/json'
204
+
205
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
206
+
207
+ begin
208
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
209
+ rescue JSON::ParserError => e
210
+ if %w(String Date DateTime).include?(return_type)
211
+ data = body
212
+ else
213
+ raise e
214
+ end
215
+ end
216
+
217
+ convert_to_type data, return_type
218
+ end
219
+
220
+ # Convert data to the given return type.
221
+ # @param [Object] data Data to be converted
222
+ # @param [String] return_type Return type
223
+ # @return [Mixed] Data in a particular type
224
+ def convert_to_type(data, return_type)
225
+ return nil if data.nil?
226
+ case return_type
227
+ when 'String'
228
+ data.to_s
229
+ when 'Integer'
230
+ data.to_i
231
+ when 'Float'
232
+ data.to_f
233
+ when 'Boolean'
234
+ data == true
235
+ when 'DateTime'
236
+ # parse date time (expecting ISO 8601 format)
237
+ DateTime.parse data
238
+ when 'Date'
239
+ # parse date time (expecting ISO 8601 format)
240
+ Date.parse data
241
+ when 'Object'
242
+ # generic object (usually a Hash), return directly
243
+ data
244
+ when /\AArray<(.+)>\z/
245
+ # e.g. Array<Pet>
246
+ sub_type = $1
247
+ data.map { |item| convert_to_type(item, sub_type) }
248
+ when /\AHash\<String, (.+)\>\z/
249
+ # e.g. Hash<String, Integer>
250
+ sub_type = $1
251
+ {}.tap do |hash|
252
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
253
+ end
254
+ else
255
+ # models, e.g. Pet
256
+ Hubspot::Conversations::VisitorIdentification.const_get(return_type).build_from_hash(data)
257
+ end
258
+ end
259
+
260
+ # Save response body into a file in (the defined) temporary folder, using the filename
261
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
262
+ # The response body is written to the file in chunks in order to handle files which
263
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
264
+ # process can use.
265
+ #
266
+ # @see Configuration#temp_folder_path
267
+ def download_file(request)
268
+ tempfile = nil
269
+ encoding = nil
270
+ request.on_headers do |response|
271
+ content_disposition = response.headers['Content-Disposition']
272
+ if content_disposition && content_disposition =~ /filename=/i
273
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
274
+ prefix = sanitize_filename(filename)
275
+ else
276
+ prefix = 'download-'
277
+ end
278
+ prefix = prefix + '-' unless prefix.end_with?('-')
279
+ encoding = response.body.encoding
280
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
281
+ @tempfile = tempfile
282
+ end
283
+ request.on_body do |chunk|
284
+ chunk.force_encoding(encoding)
285
+ tempfile.write(chunk)
286
+ end
287
+ request.on_complete do |response|
288
+ if tempfile
289
+ tempfile.close
290
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
291
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
292
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
293
+ "explicitly with `tempfile.delete`"
294
+ end
295
+ end
296
+ end
297
+
298
+ # Sanitize filename by removing path.
299
+ # e.g. ../../sun.gif becomes sun.gif
300
+ #
301
+ # @param [String] filename the filename to be sanitized
302
+ # @return [String] the sanitized filename
303
+ def sanitize_filename(filename)
304
+ filename.gsub(/.*[\/\\]/, '')
305
+ end
306
+
307
+ def build_request_url(path)
308
+ # Add leading and trailing slashes to path
309
+ path = "/#{path}".gsub(/\/+/, '/')
310
+ @config.base_url + path
311
+ end
312
+
313
+ # Update hearder and query params based on authentication settings.
314
+ #
315
+ # @param [Hash] header_params Header parameters
316
+ # @param [Hash] query_params Query parameters
317
+ # @param [String] auth_names Authentication scheme name
318
+ def update_params_for_auth!(header_params, query_params, auth_names)
319
+ Array(auth_names).each do |auth_name|
320
+ auth_setting = @config.auth_settings[auth_name]
321
+ next unless auth_setting
322
+ case auth_setting[:in]
323
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
324
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
325
+ else fail ArgumentError, 'Authentication token must be in `query` of `header`'
326
+ end
327
+ end
328
+ end
329
+
330
+ # Sets user agent in HTTP header
331
+ #
332
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
333
+ def user_agent=(user_agent)
334
+ @user_agent = user_agent
335
+ @default_headers['User-Agent'] = @user_agent
336
+ end
337
+
338
+ # Return Accept header based on an array of accepts provided.
339
+ # @param [Array] accepts array for Accept
340
+ # @return [String] the Accept header (e.g. application/json)
341
+ def select_header_accept(accepts)
342
+ return nil if accepts.nil? || accepts.empty?
343
+ # use JSON when present, otherwise use all of the provided
344
+ json_accept = accepts.find { |s| json_mime?(s) }
345
+ json_accept || accepts.join(',')
346
+ end
347
+
348
+ # Return Content-Type header based on an array of content types provided.
349
+ # @param [Array] content_types array for Content-Type
350
+ # @return [String] the Content-Type header (e.g. application/json)
351
+ def select_header_content_type(content_types)
352
+ # use application/json by default
353
+ return 'application/json' if content_types.nil? || content_types.empty?
354
+ # use JSON when present, otherwise use the first one
355
+ json_content_type = content_types.find { |s| json_mime?(s) }
356
+ json_content_type || content_types.first
357
+ end
358
+
359
+ # Convert object (array, hash, object, etc) to JSON string.
360
+ # @param [Object] model object to be converted into JSON string
361
+ # @return [String] JSON string representation of the object
362
+ def object_to_http_body(model)
363
+ return model if model.nil? || model.is_a?(String)
364
+ local_body = nil
365
+ if model.is_a?(Array)
366
+ local_body = model.map { |m| object_to_hash(m) }
367
+ else
368
+ local_body = object_to_hash(model)
369
+ end
370
+ local_body.to_json
371
+ end
372
+
373
+ # Convert object(non-array) to hash.
374
+ # @param [Object] obj object to be converted into JSON string
375
+ # @return [String] JSON string representation of the object
376
+ def object_to_hash(obj)
377
+ if obj.respond_to?(:to_hash)
378
+ obj.to_hash
379
+ else
380
+ obj
381
+ end
382
+ end
383
+
384
+ # Build parameter value according to the given collection format.
385
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
386
+ def build_collection_param(param, collection_format)
387
+ case collection_format
388
+ when :csv
389
+ param.join(',')
390
+ when :ssv
391
+ param.join(' ')
392
+ when :tsv
393
+ param.join("\t")
394
+ when :pipes
395
+ param.join('|')
396
+ when :multi
397
+ # return the array directly as typhoeus will handle it as expected
398
+ param
399
+ else
400
+ fail "unknown collection format: #{collection_format.inspect}"
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end
406
+ end