hubspot-api-client 9.3.0 → 10.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (597) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -0
  3. data/Gemfile.lock +6 -4
  4. data/LICENSE +201 -0
  5. data/README.md +1 -1
  6. data/hubspot-api-client.gemspec +2 -1
  7. data/lib/hubspot-api-client.rb +5 -664
  8. data/lib/hubspot/codegen/automation/actions/api_client.rb +14 -0
  9. data/lib/hubspot/codegen/cms/audit-logs/api_client.rb +14 -0
  10. data/lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb +2 -2
  11. data/lib/hubspot/codegen/cms/blogs/authors/api_client.rb +14 -0
  12. data/lib/hubspot/codegen/cms/blogs/blog-posts/api/default_api.rb +2 -2
  13. data/lib/hubspot/codegen/cms/blogs/blog-posts/api_client.rb +14 -0
  14. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb +108 -102
  15. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/layout_section.rb +4 -2
  16. data/lib/hubspot/codegen/cms/blogs/tags/api/default_api.rb +2 -2
  17. data/lib/hubspot/codegen/cms/blogs/tags/api_client.rb +14 -0
  18. data/lib/hubspot/codegen/cms/domains/api_client.rb +14 -0
  19. data/lib/hubspot/codegen/cms/hubdb/api/rows_api.rb +1 -1
  20. data/lib/hubspot/codegen/cms/hubdb/api/rows_batch_api.rb +1 -1
  21. data/lib/hubspot/codegen/cms/hubdb/api/tables_api.rb +1 -1
  22. data/lib/hubspot/codegen/cms/hubdb/api_client.rb +15 -1
  23. data/lib/hubspot/codegen/cms/hubdb/api_error.rb +1 -1
  24. data/lib/hubspot/codegen/cms/hubdb/configuration.rb +1 -1
  25. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_hub_db_table_row_v3.rb +1 -1
  26. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_json_node.rb +1 -1
  27. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_string.rb +1 -1
  28. data/lib/hubspot/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors.rb +1 -1
  29. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging.rb +1 -1
  30. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging.rb +1 -1
  31. data/lib/hubspot/codegen/cms/hubdb/models/column.rb +1 -1
  32. data/lib/hubspot/codegen/cms/hubdb/models/column_input.rb +1 -1
  33. data/lib/hubspot/codegen/cms/hubdb/models/error.rb +1 -1
  34. data/lib/hubspot/codegen/cms/hubdb/models/error_detail.rb +1 -1
  35. data/lib/hubspot/codegen/cms/hubdb/models/foreign_id.rb +1 -1
  36. data/lib/hubspot/codegen/cms/hubdb/models/forward_paging.rb +1 -1
  37. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_clone_request.rb +1 -1
  38. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3.rb +5 -3
  39. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3_input.rb +1 -1
  40. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3.rb +1 -1
  41. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_input.rb +1 -1
  42. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_live_input.rb +1 -1
  43. data/lib/hubspot/codegen/cms/hubdb/models/import_result.rb +1 -1
  44. data/lib/hubspot/codegen/cms/hubdb/models/next_page.rb +1 -1
  45. data/lib/hubspot/codegen/cms/hubdb/models/option.rb +1 -1
  46. data/lib/hubspot/codegen/cms/hubdb/models/simple_user.rb +1 -1
  47. data/lib/hubspot/codegen/cms/hubdb/models/standard_error.rb +1 -1
  48. data/lib/hubspot/codegen/cms/performance/api_client.rb +14 -0
  49. data/lib/hubspot/codegen/cms/site-search/api/default_api.rb +2 -5
  50. data/lib/hubspot/codegen/cms/site-search/api_client.rb +14 -0
  51. data/lib/hubspot/codegen/cms/site-search/models/content_search_result.rb +19 -2
  52. data/lib/hubspot/codegen/cms/site-search/models/indexed_data.rb +5 -2
  53. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +17 -15
  54. data/lib/hubspot/codegen/cms/url-redirects/api_client.rb +14 -0
  55. data/lib/hubspot/codegen/conversations/visitor-identification/api/generate_api.rb +90 -0
  56. data/lib/hubspot/codegen/conversations/visitor-identification/api_client.rb +406 -0
  57. data/lib/hubspot/codegen/conversations/visitor-identification/api_error.rb +61 -0
  58. data/lib/hubspot/codegen/conversations/visitor-identification/configuration.rb +263 -0
  59. data/lib/hubspot/codegen/conversations/visitor-identification/models/error.rb +292 -0
  60. data/lib/hubspot/codegen/conversations/visitor-identification/models/error_detail.rb +258 -0
  61. data/lib/hubspot/codegen/conversations/visitor-identification/models/identification_token_generation_request.rb +236 -0
  62. data/lib/hubspot/codegen/conversations/visitor-identification/models/identification_token_response.rb +215 -0
  63. data/lib/hubspot/codegen/crm/associations/api_client.rb +14 -0
  64. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +6 -12
  65. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +11 -14
  66. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +3 -3
  67. data/lib/hubspot/codegen/crm/companies/api_client.rb +14 -0
  68. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +20 -20
  69. data/lib/hubspot/codegen/crm/companies/models/collection_response_associated_id_forward_paging.rb +226 -0
  70. 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
  71. 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
  72. data/lib/hubspot/codegen/crm/companies/models/forward_paging.rb +210 -0
  73. data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +1 -12
  74. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_with_associations.rb +288 -0
  75. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +6 -12
  76. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +11 -14
  77. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +3 -3
  78. data/lib/hubspot/codegen/crm/contacts/api_client.rb +14 -0
  79. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +20 -20
  80. data/lib/hubspot/codegen/crm/contacts/models/collection_response_associated_id_forward_paging.rb +226 -0
  81. 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
  82. 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
  83. data/lib/hubspot/codegen/crm/contacts/models/forward_paging.rb +210 -0
  84. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +1 -12
  85. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_with_associations.rb +288 -0
  86. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +6 -12
  87. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +11 -14
  88. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +3 -3
  89. data/lib/hubspot/codegen/crm/deals/api_client.rb +14 -0
  90. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +20 -20
  91. data/lib/hubspot/codegen/crm/deals/models/collection_response_associated_id_forward_paging.rb +226 -0
  92. 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
  93. 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
  94. data/lib/hubspot/codegen/crm/deals/models/forward_paging.rb +210 -0
  95. data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +1 -12
  96. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_with_associations.rb +288 -0
  97. data/lib/hubspot/codegen/crm/extensions/accounting/api/callbacks_api.rb +728 -0
  98. data/lib/hubspot/codegen/crm/extensions/accounting/api/invoice_api.rb +247 -0
  99. data/lib/hubspot/codegen/crm/extensions/accounting/api/settings_api.rb +160 -0
  100. data/lib/hubspot/codegen/crm/extensions/accounting/api/sync_api.rb +168 -0
  101. data/lib/hubspot/codegen/crm/extensions/accounting/api/user_accounts_api.rb +154 -0
  102. data/lib/hubspot/codegen/crm/extensions/accounting/api_client.rb +408 -0
  103. data/lib/hubspot/codegen/crm/extensions/accounting/api_error.rb +63 -0
  104. data/lib/hubspot/codegen/crm/extensions/accounting/configuration.rb +265 -0
  105. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_app_settings.rb +241 -0
  106. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_app_urls.rb +381 -0
  107. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_customer.rb +262 -0
  108. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_invoice.rb +357 -0
  109. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_term.rb +253 -0
  110. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_features.rb +248 -0
  111. data/lib/hubspot/codegen/crm/extensions/accounting/models/action_response.rb +299 -0
  112. data/lib/hubspot/codegen/crm/extensions/accounting/models/address.rb +253 -0
  113. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_invoice_feature.rb +232 -0
  114. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_invoice_sub_features.rb +293 -0
  115. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_user_account_request_external.rb +248 -0
  116. data/lib/hubspot/codegen/crm/extensions/accounting/models/customer_search_response_external.rb +269 -0
  117. data/lib/hubspot/codegen/crm/extensions/accounting/models/error.rb +294 -0
  118. data/lib/hubspot/codegen/crm/extensions/accounting/models/error_detail.rb +260 -0
  119. data/lib/hubspot/codegen/crm/extensions/accounting/models/exchange_rate_response.rb +297 -0
  120. data/lib/hubspot/codegen/crm/extensions/accounting/models/import_invoice_feature.rb +218 -0
  121. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_create_payment_request.rb +263 -0
  122. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_pdf_response.rb +283 -0
  123. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_read_response.rb +455 -0
  124. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_search_response.rb +264 -0
  125. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_update_request.rb +281 -0
  126. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_update_response.rb +441 -0
  127. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoices_response_external.rb +264 -0
  128. data/lib/hubspot/codegen/crm/extensions/accounting/models/object_sync_feature.rb +218 -0
  129. data/lib/hubspot/codegen/crm/extensions/accounting/models/product.rb +281 -0
  130. data/lib/hubspot/codegen/crm/extensions/accounting/models/product_search_response.rb +264 -0
  131. data/lib/hubspot/codegen/crm/extensions/accounting/models/result_id_accounting_response.rb +267 -0
  132. data/lib/hubspot/codegen/crm/extensions/accounting/models/sync_contacts_request.rb +235 -0
  133. data/lib/hubspot/codegen/crm/extensions/accounting/models/sync_products_request.rb +235 -0
  134. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax.rb +248 -0
  135. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax_search_response.rb +264 -0
  136. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax_type.rb +228 -0
  137. data/lib/hubspot/codegen/crm/extensions/accounting/models/terms_response.rb +264 -0
  138. data/lib/hubspot/codegen/crm/extensions/accounting/models/unit_price.rb +228 -0
  139. data/lib/hubspot/codegen/crm/extensions/accounting/models/updated_contact.rb +319 -0
  140. data/lib/hubspot/codegen/crm/extensions/accounting/models/updated_product.rb +324 -0
  141. data/lib/hubspot/codegen/crm/extensions/calling/api/settings_api.rb +284 -0
  142. data/lib/hubspot/codegen/crm/extensions/calling/api_client.rb +408 -0
  143. data/lib/hubspot/codegen/crm/extensions/calling/api_error.rb +63 -0
  144. data/lib/hubspot/codegen/crm/extensions/calling/configuration.rb +258 -0
  145. data/lib/hubspot/codegen/crm/extensions/calling/models/error.rb +294 -0
  146. data/lib/hubspot/codegen/crm/extensions/calling/models/error_detail.rb +260 -0
  147. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_patch_request.rb +253 -0
  148. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_request.rb +263 -0
  149. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_response.rb +308 -0
  150. data/lib/hubspot/codegen/crm/extensions/cards/api_client.rb +14 -0
  151. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api/settings_api.rb +222 -0
  152. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_client.rb +408 -0
  153. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_error.rb +63 -0
  154. data/lib/hubspot/codegen/crm/extensions/videoconferencing/configuration.rb +258 -0
  155. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/error.rb +294 -0
  156. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/error_detail.rb +260 -0
  157. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/external_settings.rb +248 -0
  158. data/lib/hubspot/codegen/crm/imports/api/default_api.rb +90 -0
  159. data/lib/hubspot/codegen/crm/imports/api_client.rb +14 -0
  160. data/lib/hubspot/codegen/crm/imports/models/collection_response_public_import_error_forward_paging.rb +226 -0
  161. data/lib/hubspot/codegen/crm/imports/models/forward_paging.rb +210 -0
  162. data/lib/hubspot/codegen/crm/imports/models/import_row_core.rb +238 -0
  163. data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +353 -0
  164. data/lib/hubspot/codegen/crm/imports/models/public_import_response.rb +2 -2
  165. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +6 -12
  166. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +11 -14
  167. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +3 -3
  168. data/lib/hubspot/codegen/crm/line_items/api_client.rb +14 -0
  169. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +20 -20
  170. data/lib/hubspot/codegen/crm/line_items/models/collection_response_associated_id_forward_paging.rb +226 -0
  171. 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
  172. 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
  173. data/lib/hubspot/codegen/crm/line_items/models/forward_paging.rb +210 -0
  174. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object.rb +1 -12
  175. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_with_associations.rb +288 -0
  176. data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +6 -12
  177. data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +11 -14
  178. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +10 -10
  179. data/lib/hubspot/codegen/crm/objects/api_client.rb +14 -0
  180. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +100 -0
  181. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +175 -0
  182. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +95 -0
  183. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +92 -0
  184. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_client.rb +408 -0
  185. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_error.rb +63 -0
  186. data/lib/hubspot/codegen/crm/objects/feedback_submissions/configuration.rb +258 -0
  187. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/associated_id.rb +231 -0
  188. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input.rb +219 -0
  189. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id.rb +219 -0
  190. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input.rb +219 -0
  191. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.rb +244 -0
  192. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object.rb +315 -0
  193. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object_with_errors.rb +335 -0
  194. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id.rb +228 -0
  195. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id_forward_paging.rb +228 -0
  196. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_simple_public_object_with_associations_forward_paging.rb +228 -0
  197. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_with_total_simple_public_object_forward_paging.rb +242 -0
  198. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/error.rb +294 -0
  199. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/error_category.rb +265 -0
  200. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/error_detail.rb +260 -0
  201. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/filter.rb +274 -0
  202. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/filter_group.rb +219 -0
  203. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/forward_paging.rb +212 -0
  204. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/next_page.rb +226 -0
  205. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/paging.rb +221 -0
  206. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/previous_page.rb +226 -0
  207. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/public_object_search_request.rb +288 -0
  208. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object.rb +279 -0
  209. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_batch_input.rb +233 -0
  210. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_id.rb +217 -0
  211. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_input.rb +219 -0
  212. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations.rb +290 -0
  213. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/standard_error.rb +311 -0
  214. data/lib/hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id.rb +20 -20
  215. data/lib/hubspot/codegen/crm/objects/models/collection_response_associated_id_forward_paging.rb +226 -0
  216. 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
  217. 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
  218. data/lib/hubspot/codegen/crm/objects/models/forward_paging.rb +210 -0
  219. data/lib/hubspot/codegen/crm/objects/models/simple_public_object.rb +1 -12
  220. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_with_associations.rb +288 -0
  221. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +9 -3
  222. data/lib/hubspot/codegen/crm/owners/api_client.rb +14 -0
  223. data/lib/hubspot/codegen/crm/owners/models/{collection_response_public_owner.rb → collection_response_public_owner_forward_paging.rb} +4 -4
  224. data/lib/hubspot/codegen/crm/owners/models/{paging.rb → forward_paging.rb} +3 -3
  225. data/lib/hubspot/codegen/crm/pipelines/api_client.rb +14 -0
  226. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +6 -12
  227. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +11 -14
  228. data/lib/hubspot/codegen/crm/products/api/search_api.rb +3 -3
  229. data/lib/hubspot/codegen/crm/products/api_client.rb +14 -0
  230. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +20 -20
  231. data/lib/hubspot/codegen/crm/products/models/collection_response_associated_id_forward_paging.rb +226 -0
  232. 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
  233. 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
  234. data/lib/hubspot/codegen/crm/products/models/forward_paging.rb +210 -0
  235. data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +1 -12
  236. data/lib/hubspot/codegen/crm/products/models/simple_public_object_with_associations.rb +288 -0
  237. data/lib/hubspot/codegen/crm/properties/api_client.rb +14 -0
  238. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +3 -6
  239. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +6 -12
  240. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +3 -3
  241. data/lib/hubspot/codegen/crm/quotes/api_client.rb +14 -0
  242. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +20 -20
  243. data/lib/hubspot/codegen/crm/quotes/models/collection_response_associated_id_forward_paging.rb +226 -0
  244. 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
  245. 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
  246. data/lib/hubspot/codegen/crm/quotes/models/forward_paging.rb +210 -0
  247. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object.rb +1 -12
  248. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_with_associations.rb +288 -0
  249. data/lib/hubspot/codegen/crm/schemas/api/core_api.rb +23 -17
  250. data/lib/hubspot/codegen/crm/schemas/api_client.rb +14 -0
  251. data/lib/hubspot/codegen/crm/schemas/models/association_definition.rb +1 -75
  252. data/lib/hubspot/codegen/crm/schemas/models/association_definition_egg.rb +4 -78
  253. data/lib/hubspot/codegen/crm/schemas/models/{collection_response_object_schema.rb → collection_response_object_schema_no_paging.rb} +7 -16
  254. data/lib/hubspot/codegen/crm/schemas/models/object_schema.rb +15 -1
  255. data/lib/hubspot/codegen/crm/schemas/models/object_type_definition.rb +15 -1
  256. data/lib/hubspot/codegen/crm/schemas/models/object_type_property_create.rb +2 -2
  257. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +6 -12
  258. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +11 -14
  259. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +3 -3
  260. data/lib/hubspot/codegen/crm/tickets/api_client.rb +14 -0
  261. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +20 -20
  262. data/lib/hubspot/codegen/crm/tickets/models/collection_response_associated_id_forward_paging.rb +226 -0
  263. 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
  264. 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
  265. data/lib/hubspot/codegen/crm/tickets/models/forward_paging.rb +210 -0
  266. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +1 -12
  267. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_with_associations.rb +288 -0
  268. data/lib/hubspot/codegen/crm/timeline/api_client.rb +14 -0
  269. data/lib/hubspot/codegen/events/api/events_api.rb +105 -0
  270. data/lib/hubspot/codegen/events/api_client.rb +404 -0
  271. data/lib/hubspot/codegen/events/api_error.rb +59 -0
  272. data/lib/hubspot/codegen/events/configuration.rb +261 -0
  273. data/lib/hubspot/codegen/events/models/collection_response_external_unified_event.rb +224 -0
  274. data/lib/hubspot/codegen/events/models/error.rb +290 -0
  275. data/lib/hubspot/codegen/events/models/error_detail.rb +256 -0
  276. data/lib/hubspot/codegen/events/models/external_unified_event.rb +290 -0
  277. data/lib/hubspot/codegen/events/models/next_page.rb +222 -0
  278. data/lib/hubspot/codegen/events/models/paging.rb +208 -0
  279. data/lib/hubspot/codegen/files/files/api/files_api.rb +787 -0
  280. data/lib/hubspot/codegen/files/files/api/folders_api.rb +579 -0
  281. data/lib/hubspot/codegen/files/files/api_client.rb +406 -0
  282. data/lib/hubspot/codegen/files/files/api_error.rb +61 -0
  283. data/lib/hubspot/codegen/files/files/configuration.rb +263 -0
  284. data/lib/hubspot/codegen/files/files/models/collection_response_file.rb +226 -0
  285. data/lib/hubspot/codegen/files/files/models/collection_response_folder.rb +226 -0
  286. data/lib/hubspot/codegen/files/files/models/error.rb +292 -0
  287. data/lib/hubspot/codegen/files/files/models/error_category.rb +263 -0
  288. data/lib/hubspot/codegen/files/files/models/error_detail.rb +258 -0
  289. data/lib/hubspot/codegen/files/files/models/file_action_response.rb +348 -0
  290. data/lib/hubspot/codegen/files/files/models/file_update_input.rb +285 -0
  291. data/lib/hubspot/codegen/files/files/models/folder.rb +301 -0
  292. data/lib/hubspot/codegen/files/files/models/folder_action_response.rb +348 -0
  293. data/lib/hubspot/codegen/files/files/models/folder_input.rb +236 -0
  294. data/lib/hubspot/codegen/files/files/models/folder_update_input.rb +236 -0
  295. data/lib/hubspot/codegen/files/files/models/folder_update_task_locator.rb +228 -0
  296. data/lib/hubspot/codegen/files/files/models/hubspot_file.rb +440 -0
  297. data/lib/hubspot/codegen/files/files/models/import_from_url_input.rb +374 -0
  298. data/lib/hubspot/codegen/files/files/models/import_from_url_task_locator.rb +228 -0
  299. data/lib/hubspot/codegen/{crm/schemas → files/files}/models/next_page.rb +7 -7
  300. data/lib/hubspot/codegen/{crm/schemas → files/files}/models/paging.rb +7 -7
  301. data/lib/hubspot/codegen/{crm/schemas → files/files}/models/previous_page.rb +7 -7
  302. data/lib/hubspot/codegen/files/files/models/signed_url.rb +311 -0
  303. data/lib/hubspot/codegen/files/files/models/standard_error.rb +309 -0
  304. data/lib/hubspot/codegen/marketing/transactional/api/default_api.rb +400 -0
  305. data/lib/hubspot/codegen/marketing/transactional/api_client.rb +406 -0
  306. data/lib/hubspot/codegen/marketing/transactional/api_error.rb +61 -0
  307. data/lib/hubspot/codegen/marketing/transactional/configuration.rb +263 -0
  308. data/lib/hubspot/codegen/marketing/transactional/models/collection_response_smtp_api_token_view.rb +227 -0
  309. data/lib/hubspot/codegen/marketing/transactional/models/email_send_status_view.rb +326 -0
  310. data/lib/hubspot/codegen/marketing/transactional/models/error.rb +292 -0
  311. data/lib/hubspot/codegen/marketing/transactional/models/error_detail.rb +258 -0
  312. data/lib/hubspot/codegen/marketing/transactional/models/event_id_view.rb +231 -0
  313. data/lib/hubspot/codegen/marketing/transactional/models/next_page.rb +224 -0
  314. data/lib/hubspot/codegen/marketing/transactional/models/paging.rb +210 -0
  315. data/lib/hubspot/codegen/marketing/transactional/models/public_single_send_email.rb +282 -0
  316. data/lib/hubspot/codegen/marketing/transactional/models/public_single_send_request_egg.rb +262 -0
  317. data/lib/hubspot/codegen/marketing/transactional/models/smtp_api_token_request_egg.rb +231 -0
  318. data/lib/hubspot/codegen/marketing/transactional/models/smtp_api_token_view.rb +301 -0
  319. data/lib/hubspot/codegen/oauth/api_client.rb +14 -0
  320. data/lib/hubspot/codegen/webhooks/api_client.rb +14 -0
  321. data/lib/hubspot/version.rb +1 -1
  322. data/spec/codegen/cms/blogs/authors/api/default_api_spec.rb +24 -24
  323. data/spec/codegen/cms/blogs/blog-posts/api/default_api_spec.rb +26 -26
  324. data/spec/codegen/cms/blogs/blog-posts/models/blog_post_spec.rb +14 -14
  325. data/spec/codegen/cms/blogs/tags/api/default_api_spec.rb +24 -24
  326. data/spec/codegen/cms/hubdb/api/rows_api_spec.rb +1 -1
  327. data/spec/codegen/cms/hubdb/api/rows_batch_api_spec.rb +1 -1
  328. data/spec/codegen/cms/hubdb/api/tables_api_spec.rb +1 -1
  329. data/spec/codegen/cms/hubdb/models/batch_input_hub_db_table_row_v3_spec.rb +1 -1
  330. data/spec/codegen/cms/hubdb/models/batch_input_json_node_spec.rb +1 -1
  331. data/spec/codegen/cms/hubdb/models/batch_input_string_spec.rb +1 -1
  332. data/spec/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors_spec.rb +1 -1
  333. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging_spec.rb +1 -1
  334. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging_spec.rb +1 -1
  335. data/spec/codegen/cms/hubdb/models/column_input_spec.rb +1 -1
  336. data/spec/codegen/cms/hubdb/models/column_spec.rb +1 -1
  337. data/spec/codegen/cms/hubdb/models/error_detail_spec.rb +1 -1
  338. data/spec/codegen/cms/hubdb/models/error_spec.rb +1 -1
  339. data/spec/codegen/cms/hubdb/models/foreign_id_spec.rb +1 -1
  340. data/spec/codegen/cms/hubdb/models/forward_paging_spec.rb +1 -1
  341. data/spec/codegen/cms/hubdb/models/hub_db_table_clone_request_spec.rb +1 -1
  342. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_input_spec.rb +1 -1
  343. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_spec.rb +1 -1
  344. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_input_spec.rb +1 -1
  345. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_live_input_spec.rb +1 -1
  346. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_spec.rb +1 -1
  347. data/spec/codegen/cms/hubdb/models/import_result_spec.rb +1 -1
  348. data/spec/codegen/cms/hubdb/models/next_page_spec.rb +1 -1
  349. data/spec/codegen/cms/hubdb/models/option_spec.rb +1 -1
  350. data/spec/codegen/cms/hubdb/models/simple_user_spec.rb +1 -1
  351. data/spec/codegen/cms/hubdb/models/standard_error_spec.rb +1 -1
  352. data/spec/codegen/cms/site-search/api/default_api_spec.rb +0 -1
  353. data/spec/codegen/cms/site-search/models/content_search_result_spec.rb +1 -1
  354. data/spec/codegen/cms/site-search/models/indexed_data_spec.rb +1 -1
  355. data/spec/codegen/cms/site-search/models/search_hit_field_spec.rb +2 -2
  356. data/spec/codegen/conversations/visitor-identification/api/generate_api_spec.rb +47 -0
  357. data/spec/codegen/conversations/visitor-identification/models/error_detail_spec.rb +65 -0
  358. data/spec/codegen/conversations/visitor-identification/models/error_spec.rb +77 -0
  359. data/spec/codegen/conversations/visitor-identification/models/identification_token_generation_request_spec.rb +53 -0
  360. data/spec/codegen/conversations/visitor-identification/models/identification_token_response_spec.rb +41 -0
  361. data/spec/codegen/crm/companies/api/associations_api_spec.rb +2 -4
  362. data/spec/codegen/crm/companies/api/basic_api_spec.rb +4 -5
  363. data/spec/codegen/crm/companies/api/search_api_spec.rb +1 -1
  364. data/spec/codegen/crm/companies/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  365. data/spec/codegen/crm/companies/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  366. 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
  367. 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
  368. data/spec/codegen/crm/companies/models/forward_paging_spec.rb +41 -0
  369. data/spec/codegen/crm/companies/models/simple_public_object_spec.rb +0 -6
  370. data/spec/codegen/crm/companies/models/simple_public_object_with_associations_spec.rb +77 -0
  371. data/spec/codegen/crm/contacts/api/associations_api_spec.rb +2 -4
  372. data/spec/codegen/crm/contacts/api/basic_api_spec.rb +4 -5
  373. data/spec/codegen/crm/contacts/api/search_api_spec.rb +1 -1
  374. data/spec/codegen/crm/contacts/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  375. data/spec/codegen/crm/contacts/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  376. 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
  377. 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
  378. data/spec/codegen/crm/contacts/models/forward_paging_spec.rb +41 -0
  379. data/spec/codegen/crm/contacts/models/simple_public_object_spec.rb +0 -6
  380. data/spec/codegen/crm/contacts/models/simple_public_object_with_associations_spec.rb +77 -0
  381. data/spec/codegen/crm/deals/api/associations_api_spec.rb +2 -4
  382. data/spec/codegen/crm/deals/api/basic_api_spec.rb +4 -5
  383. data/spec/codegen/crm/deals/api/search_api_spec.rb +1 -1
  384. data/spec/codegen/crm/deals/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  385. data/spec/codegen/crm/deals/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  386. 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
  387. 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
  388. data/spec/codegen/crm/deals/models/forward_paging_spec.rb +41 -0
  389. data/spec/codegen/crm/deals/models/simple_public_object_spec.rb +0 -6
  390. data/spec/codegen/crm/deals/models/simple_public_object_with_associations_spec.rb +77 -0
  391. data/spec/codegen/crm/extensions/accounting/api/callbacks_api_spec.rb +165 -0
  392. data/spec/codegen/crm/extensions/accounting/api/invoice_api_spec.rb +76 -0
  393. data/spec/codegen/crm/extensions/accounting/api/settings_api_spec.rb +60 -0
  394. data/spec/codegen/crm/extensions/accounting/api/sync_api_spec.rb +61 -0
  395. data/spec/codegen/crm/extensions/accounting/api/user_accounts_api_spec.rb +59 -0
  396. data/spec/codegen/crm/extensions/accounting/models/accounting_app_settings_spec.rb +53 -0
  397. data/spec/codegen/crm/extensions/accounting/models/accounting_app_urls_spec.rb +125 -0
  398. data/spec/codegen/crm/extensions/accounting/models/accounting_extension_customer_spec.rb +65 -0
  399. data/spec/codegen/crm/extensions/accounting/models/accounting_extension_invoice_spec.rb +93 -0
  400. data/spec/codegen/crm/extensions/accounting/models/accounting_extension_term_spec.rb +59 -0
  401. data/spec/codegen/crm/extensions/accounting/models/accounting_features_spec.rb +53 -0
  402. data/spec/codegen/crm/extensions/accounting/models/action_response_spec.rb +69 -0
  403. data/spec/codegen/crm/extensions/accounting/models/address_spec.rb +65 -0
  404. data/spec/codegen/crm/extensions/accounting/models/create_invoice_feature_spec.rb +47 -0
  405. data/spec/codegen/crm/extensions/accounting/models/create_invoice_sub_features_spec.rb +71 -0
  406. data/spec/codegen/crm/extensions/accounting/models/create_user_account_request_external_spec.rb +53 -0
  407. data/spec/codegen/crm/extensions/accounting/models/customer_search_response_external_spec.rb +51 -0
  408. data/spec/codegen/crm/extensions/accounting/models/error_detail_spec.rb +65 -0
  409. data/spec/codegen/crm/extensions/accounting/models/error_spec.rb +77 -0
  410. data/spec/codegen/crm/extensions/accounting/models/exchange_rate_response_spec.rb +63 -0
  411. data/spec/codegen/crm/extensions/accounting/models/import_invoice_feature_spec.rb +41 -0
  412. data/spec/codegen/crm/extensions/accounting/models/invoice_create_payment_request_spec.rb +59 -0
  413. data/spec/codegen/crm/extensions/accounting/models/invoice_pdf_response_spec.rb +51 -0
  414. data/spec/codegen/crm/extensions/accounting/models/invoice_read_response_spec.rb +135 -0
  415. data/spec/codegen/crm/extensions/accounting/models/invoice_search_response_spec.rb +51 -0
  416. data/spec/codegen/crm/extensions/accounting/models/invoice_update_request_spec.rb +83 -0
  417. data/spec/codegen/crm/extensions/accounting/models/invoice_update_response_spec.rb +135 -0
  418. data/spec/codegen/crm/extensions/accounting/models/invoices_response_external_spec.rb +51 -0
  419. data/spec/codegen/crm/extensions/accounting/models/object_sync_feature_spec.rb +41 -0
  420. data/spec/codegen/crm/extensions/accounting/models/product_search_response_spec.rb +51 -0
  421. data/spec/codegen/crm/extensions/accounting/models/product_spec.rb +71 -0
  422. data/spec/codegen/crm/extensions/accounting/models/result_id_accounting_response_spec.rb +51 -0
  423. data/spec/codegen/crm/extensions/accounting/models/sync_contacts_request_spec.rb +47 -0
  424. data/spec/codegen/crm/extensions/accounting/models/sync_products_request_spec.rb +47 -0
  425. data/spec/codegen/crm/extensions/accounting/models/tax_search_response_spec.rb +51 -0
  426. data/spec/codegen/crm/extensions/accounting/models/tax_spec.rb +53 -0
  427. data/spec/codegen/crm/extensions/accounting/models/tax_type_spec.rb +47 -0
  428. data/spec/codegen/crm/extensions/accounting/models/terms_response_spec.rb +51 -0
  429. data/spec/codegen/crm/extensions/accounting/models/unit_price_spec.rb +47 -0
  430. data/spec/codegen/crm/extensions/accounting/models/updated_contact_spec.rb +73 -0
  431. data/spec/codegen/crm/extensions/accounting/models/updated_product_spec.rb +75 -0
  432. data/spec/codegen/crm/extensions/calling/api/settings_api_spec.rb +85 -0
  433. data/spec/codegen/crm/extensions/calling/models/error_detail_spec.rb +65 -0
  434. data/spec/codegen/crm/extensions/calling/models/error_spec.rb +77 -0
  435. data/spec/codegen/crm/extensions/calling/models/settings_patch_request_spec.rb +65 -0
  436. data/spec/codegen/crm/extensions/calling/models/settings_request_spec.rb +65 -0
  437. data/spec/codegen/crm/extensions/calling/models/settings_response_spec.rb +77 -0
  438. data/spec/codegen/crm/extensions/videoconferencing/api/settings_api_spec.rb +72 -0
  439. data/spec/codegen/crm/extensions/videoconferencing/models/error_detail_spec.rb +65 -0
  440. data/spec/codegen/crm/extensions/videoconferencing/models/error_spec.rb +77 -0
  441. data/spec/codegen/crm/extensions/videoconferencing/models/external_settings_spec.rb +59 -0
  442. data/spec/codegen/crm/imports/api/default_api_spec.rb +47 -0
  443. data/spec/codegen/crm/imports/models/collection_response_public_import_error_forward_paging_spec.rb +47 -0
  444. data/spec/codegen/crm/imports/models/forward_paging_spec.rb +41 -0
  445. data/spec/codegen/crm/imports/models/import_row_core_spec.rb +53 -0
  446. data/spec/codegen/crm/imports/models/public_import_error_spec.rb +97 -0
  447. data/spec/codegen/crm/imports/models/public_import_response_spec.rb +1 -1
  448. data/spec/codegen/crm/line_items/api/associations_api_spec.rb +2 -4
  449. data/spec/codegen/crm/line_items/api/basic_api_spec.rb +4 -5
  450. data/spec/codegen/crm/line_items/api/search_api_spec.rb +1 -1
  451. data/spec/codegen/crm/line_items/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  452. data/spec/codegen/crm/line_items/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  453. 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
  454. 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
  455. data/spec/codegen/crm/line_items/models/forward_paging_spec.rb +41 -0
  456. data/spec/codegen/crm/line_items/models/simple_public_object_spec.rb +0 -6
  457. data/spec/codegen/crm/line_items/models/simple_public_object_with_associations_spec.rb +77 -0
  458. data/spec/codegen/crm/objects/api/associations_api_spec.rb +2 -4
  459. data/spec/codegen/crm/objects/api/basic_api_spec.rb +4 -5
  460. data/spec/codegen/crm/objects/api/search_api_spec.rb +3 -3
  461. data/spec/codegen/crm/objects/feedback_submissions/api/associations_api_spec.rb +49 -0
  462. data/spec/codegen/crm/objects/feedback_submissions/api/basic_api_spec.rb +67 -0
  463. data/spec/codegen/crm/objects/feedback_submissions/api/batch_api_spec.rb +48 -0
  464. data/spec/codegen/crm/objects/feedback_submissions/api/search_api_spec.rb +47 -0
  465. data/spec/codegen/crm/objects/feedback_submissions/models/associated_id_spec.rb +47 -0
  466. data/spec/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input_spec.rb +41 -0
  467. data/spec/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id_spec.rb +41 -0
  468. data/spec/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input_spec.rb +41 -0
  469. data/spec/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id_spec.rb +53 -0
  470. data/spec/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object_spec.rb +75 -0
  471. data/spec/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object_with_errors_spec.rb +87 -0
  472. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  473. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id_spec.rb +47 -0
  474. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_simple_public_object_with_associations_forward_paging_spec.rb +47 -0
  475. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_with_total_simple_public_object_forward_paging_spec.rb +53 -0
  476. data/spec/codegen/crm/objects/feedback_submissions/models/error_category_spec.rb +51 -0
  477. data/spec/codegen/crm/objects/feedback_submissions/models/error_detail_spec.rb +65 -0
  478. data/spec/codegen/crm/objects/feedback_submissions/models/error_spec.rb +77 -0
  479. data/spec/codegen/crm/objects/feedback_submissions/models/filter_group_spec.rb +41 -0
  480. data/spec/codegen/crm/objects/feedback_submissions/models/filter_spec.rb +57 -0
  481. data/spec/codegen/crm/objects/feedback_submissions/models/forward_paging_spec.rb +41 -0
  482. data/spec/codegen/crm/objects/feedback_submissions/models/next_page_spec.rb +47 -0
  483. data/spec/codegen/crm/objects/feedback_submissions/models/paging_spec.rb +47 -0
  484. data/spec/codegen/crm/objects/feedback_submissions/models/previous_page_spec.rb +47 -0
  485. data/spec/codegen/crm/objects/feedback_submissions/models/public_object_search_request_spec.rb +71 -0
  486. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_batch_input_spec.rb +47 -0
  487. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_id_spec.rb +41 -0
  488. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_input_spec.rb +41 -0
  489. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_spec.rb +71 -0
  490. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations_spec.rb +77 -0
  491. data/spec/codegen/crm/objects/feedback_submissions/models/standard_error_spec.rb +83 -0
  492. data/spec/codegen/crm/objects/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  493. data/spec/codegen/crm/objects/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  494. 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
  495. 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
  496. data/spec/codegen/crm/objects/models/forward_paging_spec.rb +41 -0
  497. data/spec/codegen/crm/objects/models/simple_public_object_spec.rb +0 -6
  498. data/spec/codegen/crm/objects/models/simple_public_object_with_associations_spec.rb +77 -0
  499. data/spec/codegen/crm/owners/api/default_api_spec.rb +3 -1
  500. data/spec/codegen/crm/owners/models/{collection_response_public_owner_spec.rb → collection_response_public_owner_forward_paging_spec.rb} +6 -6
  501. data/spec/codegen/crm/owners/models/{paging_spec.rb → forward_paging_spec.rb} +6 -6
  502. data/spec/codegen/crm/products/api/associations_api_spec.rb +2 -4
  503. data/spec/codegen/crm/products/api/basic_api_spec.rb +4 -5
  504. data/spec/codegen/crm/products/api/search_api_spec.rb +1 -1
  505. data/spec/codegen/crm/products/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  506. data/spec/codegen/crm/products/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  507. 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
  508. 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
  509. data/spec/codegen/crm/products/models/forward_paging_spec.rb +41 -0
  510. data/spec/codegen/crm/products/models/simple_public_object_spec.rb +0 -6
  511. data/spec/codegen/crm/products/models/simple_public_object_with_associations_spec.rb +77 -0
  512. data/spec/codegen/crm/quotes/api/associations_api_spec.rb +1 -2
  513. data/spec/codegen/crm/quotes/api/basic_api_spec.rb +2 -4
  514. data/spec/codegen/crm/quotes/api/search_api_spec.rb +1 -1
  515. data/spec/codegen/crm/quotes/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  516. data/spec/codegen/crm/quotes/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  517. 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
  518. 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
  519. data/spec/codegen/crm/quotes/models/forward_paging_spec.rb +41 -0
  520. data/spec/codegen/crm/quotes/models/simple_public_object_spec.rb +0 -6
  521. data/spec/codegen/crm/quotes/models/simple_public_object_with_associations_spec.rb +77 -0
  522. data/spec/codegen/crm/schemas/api/core_api_spec.rb +10 -8
  523. data/spec/codegen/crm/schemas/models/association_definition_egg_spec.rb +0 -20
  524. data/spec/codegen/crm/schemas/models/association_definition_spec.rb +0 -20
  525. data/spec/codegen/crm/schemas/models/{collection_response_object_schema_spec.rb → collection_response_object_schema_no_paging_spec.rb} +6 -12
  526. data/spec/codegen/crm/schemas/models/object_schema_spec.rb +6 -0
  527. data/spec/codegen/crm/schemas/models/object_type_definition_spec.rb +6 -0
  528. data/spec/codegen/crm/schemas/models/object_type_property_create_spec.rb +1 -1
  529. data/spec/codegen/crm/tickets/api/associations_api_spec.rb +2 -4
  530. data/spec/codegen/crm/tickets/api/basic_api_spec.rb +4 -5
  531. data/spec/codegen/crm/tickets/api/search_api_spec.rb +1 -1
  532. data/spec/codegen/crm/tickets/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  533. data/spec/codegen/crm/tickets/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  534. 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
  535. 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
  536. data/spec/codegen/crm/tickets/models/forward_paging_spec.rb +41 -0
  537. data/spec/codegen/crm/tickets/models/simple_public_object_spec.rb +0 -6
  538. data/spec/codegen/crm/tickets/models/simple_public_object_with_associations_spec.rb +77 -0
  539. data/spec/codegen/events/api/events_api_spec.rb +54 -0
  540. data/spec/codegen/events/models/collection_response_external_unified_event_spec.rb +47 -0
  541. data/spec/codegen/events/models/error_detail_spec.rb +65 -0
  542. data/spec/codegen/events/models/error_spec.rb +77 -0
  543. data/spec/codegen/events/models/external_unified_event_spec.rb +71 -0
  544. data/spec/codegen/events/models/next_page_spec.rb +47 -0
  545. data/spec/codegen/events/models/paging_spec.rb +41 -0
  546. data/spec/codegen/files/files/api/files_api_spec.rb +189 -0
  547. data/spec/codegen/files/files/api/folders_api_spec.rb +143 -0
  548. data/spec/codegen/files/files/models/collection_response_file_spec.rb +47 -0
  549. data/spec/codegen/files/files/models/collection_response_folder_spec.rb +47 -0
  550. data/spec/codegen/files/files/models/error_category_spec.rb +51 -0
  551. data/spec/codegen/files/files/models/error_detail_spec.rb +65 -0
  552. data/spec/codegen/files/files/models/error_spec.rb +77 -0
  553. data/spec/codegen/files/files/models/file_action_response_spec.rb +93 -0
  554. data/spec/codegen/files/files/models/file_update_input_spec.rb +69 -0
  555. data/spec/codegen/files/files/models/folder_action_response_spec.rb +93 -0
  556. data/spec/codegen/files/files/models/folder_input_spec.rb +53 -0
  557. data/spec/codegen/files/files/models/folder_spec.rb +83 -0
  558. data/spec/codegen/files/files/models/folder_update_input_spec.rb +53 -0
  559. data/spec/codegen/files/files/models/folder_update_task_locator_spec.rb +47 -0
  560. data/spec/codegen/files/files/models/hubspot_file_spec.rb +147 -0
  561. data/spec/codegen/files/files/models/import_from_url_input_spec.rb +101 -0
  562. data/spec/codegen/files/files/models/import_from_url_task_locator_spec.rb +47 -0
  563. data/spec/codegen/{crm/schemas → files/files}/models/next_page_spec.rb +5 -5
  564. data/spec/codegen/{crm/schemas → files/files}/models/paging_spec.rb +5 -5
  565. data/spec/codegen/{crm/schemas → files/files}/models/previous_page_spec.rb +5 -5
  566. data/spec/codegen/files/files/models/signed_url_spec.rb +83 -0
  567. data/spec/codegen/files/files/models/standard_error_spec.rb +83 -0
  568. data/spec/codegen/marketing/transactional/api/default_api_spec.rb +110 -0
  569. data/spec/codegen/marketing/transactional/models/collection_response_smtp_api_token_view_spec.rb +47 -0
  570. data/spec/codegen/marketing/transactional/models/email_send_status_view_spec.rb +85 -0
  571. data/spec/codegen/marketing/transactional/models/error_detail_spec.rb +65 -0
  572. data/spec/codegen/marketing/transactional/models/error_spec.rb +77 -0
  573. data/spec/codegen/marketing/transactional/models/event_id_view_spec.rb +47 -0
  574. data/spec/codegen/marketing/transactional/models/next_page_spec.rb +47 -0
  575. data/spec/codegen/marketing/transactional/models/paging_spec.rb +41 -0
  576. data/spec/codegen/marketing/transactional/models/public_single_send_email_spec.rb +71 -0
  577. data/spec/codegen/marketing/transactional/models/public_single_send_request_egg_spec.rb +59 -0
  578. data/spec/codegen/marketing/transactional/models/smtp_api_token_request_egg_spec.rb +47 -0
  579. data/spec/codegen/marketing/transactional/models/smtp_api_token_view_spec.rb +77 -0
  580. data/spec/features/conversations/visitor-identification/generate_api_spec.rb +7 -0
  581. data/spec/features/crm/extensions/accounting/callbacks_api_spec.rb +16 -0
  582. data/spec/features/crm/extensions/accounting/invoice_api_spec.rb +9 -0
  583. data/spec/features/crm/extensions/accounting/settings_api_spec.rb +8 -0
  584. data/spec/features/crm/extensions/accounting/sync_api_spec.rb +8 -0
  585. data/spec/features/crm/extensions/accounting/user_accounts_api_spec.rb +8 -0
  586. data/spec/features/crm/extensions/calling/settings_api_spec.rb +10 -0
  587. data/spec/features/crm/extensions/videoconferencing/settings_api_spec.rb +9 -0
  588. data/spec/features/crm/objects/feedback_submissions/associations_api_spec.rb +7 -0
  589. data/spec/features/crm/objects/feedback_submissions/basic_api_spec.rb +8 -0
  590. data/spec/features/crm/objects/feedback_submissions/batch_api_spec.rb +7 -0
  591. data/spec/features/crm/objects/feedback_submissions/search_api_spec.rb +7 -0
  592. data/spec/features/crm/objects/search_api_spec.rb +1 -1
  593. data/spec/features/events/events_api_spec.rb +7 -0
  594. data/spec/features/files/files/files_api_spec.rb +16 -0
  595. data/spec/features/files/files/folders_api_spec.rb +14 -0
  596. data/spec/features/marketing/transactional/default_api_spec.rb +12 -0
  597. metadata +602 -69
@@ -57,6 +57,20 @@ module Hubspot
57
57
  end
58
58
 
59
59
  unless response.success?
60
+ if config.error_handler.any?
61
+ config.error_handler.each do |statuses, opts|
62
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
63
+
64
+ retries = opts[:max_retries] || 5
65
+ while retries > 0 && statuses.include?(response.code)
66
+ sleep opts[:seconds_delay] if opts[:seconds_delay]
67
+ response = request.run
68
+ opts[:retry_block].call if opts[:retry_block]
69
+ retries -= 1
70
+ end
71
+ end
72
+ end
73
+
60
74
  if response.timed_out?
61
75
  fail ApiError.new('Connection timed out')
62
76
  elsif response.code == 0
@@ -0,0 +1,222 @@
1
+ =begin
2
+ #Video Conference Extension
3
+
4
+ #These APIs allow you to specify URLs that can be used to interact with a video conferencing application, to allow HubSpot to add video conference links to meeting requests with contacts.
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 Crm
17
+ module Extensions
18
+ module Videoconferencing
19
+ class SettingsApi
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = ApiClient.default)
23
+ @api_client = api_client
24
+ end
25
+ # Delete settings
26
+ # Deletes the settings for a video conference application with the specified ID.
27
+ # @param app_id [Integer] The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [nil]
30
+ def archive(app_id, opts = {})
31
+ archive_with_http_info(app_id, opts)
32
+ nil
33
+ end
34
+
35
+ # Delete settings
36
+ # Deletes the settings for a video conference application with the specified ID.
37
+ # @param app_id [Integer] The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
40
+ def archive_with_http_info(app_id, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug 'Calling API: SettingsApi.archive ...'
43
+ end
44
+ # verify the required parameter 'app_id' is set
45
+ if @api_client.config.client_side_validation && app_id.nil?
46
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling SettingsApi.archive"
47
+ end
48
+ # resource path
49
+ local_var_path = '/crm/v3/extensions/videoconferencing/settings/{appId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))
50
+
51
+ # query parameters
52
+ query_params = opts[:query_params] || {}
53
+
54
+ # header parameters
55
+ header_params = opts[:header_params] || {}
56
+ # HTTP header 'Accept' (if needed)
57
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:body]
64
+
65
+ # return_type
66
+ return_type = opts[:return_type]
67
+
68
+ # auth_names
69
+ auth_names = opts[:auth_names] || ['hapikey']
70
+
71
+ new_options = opts.merge(
72
+ :header_params => header_params,
73
+ :query_params => query_params,
74
+ :form_params => form_params,
75
+ :body => post_body,
76
+ :auth_names => auth_names,
77
+ :return_type => return_type
78
+ )
79
+
80
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: SettingsApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+
87
+ # Get settings
88
+ # Return the settings for a video conference application with the specified ID.
89
+ # @param app_id [Integer] The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [ExternalSettings]
92
+ def get_by_id(app_id, opts = {})
93
+ data, _status_code, _headers = get_by_id_with_http_info(app_id, opts)
94
+ data
95
+ end
96
+
97
+ # Get settings
98
+ # Return the settings for a video conference application with the specified ID.
99
+ # @param app_id [Integer] The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<(ExternalSettings, Integer, Hash)>] ExternalSettings data, response status code and response headers
102
+ def get_by_id_with_http_info(app_id, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: SettingsApi.get_by_id ...'
105
+ end
106
+ # verify the required parameter 'app_id' is set
107
+ if @api_client.config.client_side_validation && app_id.nil?
108
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling SettingsApi.get_by_id"
109
+ end
110
+ # resource path
111
+ local_var_path = '/crm/v3/extensions/videoconferencing/settings/{appId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
120
+
121
+ # form parameters
122
+ form_params = opts[:form_params] || {}
123
+
124
+ # http body (model)
125
+ post_body = opts[:body]
126
+
127
+ # return_type
128
+ return_type = opts[:return_type] || 'ExternalSettings'
129
+
130
+ # auth_names
131
+ auth_names = opts[:auth_names] || ['hapikey']
132
+
133
+ new_options = opts.merge(
134
+ :header_params => header_params,
135
+ :query_params => query_params,
136
+ :form_params => form_params,
137
+ :body => post_body,
138
+ :auth_names => auth_names,
139
+ :return_type => return_type
140
+ )
141
+
142
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
143
+ if @api_client.config.debugging
144
+ @api_client.config.logger.debug "API called: SettingsApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
145
+ end
146
+ return data, status_code, headers
147
+ end
148
+
149
+ # Update settings
150
+ # Updates the settings for a video conference application with the specified ID.
151
+ # @param app_id [Integer] The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
152
+ # @param external_settings [ExternalSettings]
153
+ # @param [Hash] opts the optional parameters
154
+ # @return [ExternalSettings]
155
+ def replace(app_id, external_settings, opts = {})
156
+ data, _status_code, _headers = replace_with_http_info(app_id, external_settings, opts)
157
+ data
158
+ end
159
+
160
+ # Update settings
161
+ # Updates the settings for a video conference application with the specified ID.
162
+ # @param app_id [Integer] The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
163
+ # @param external_settings [ExternalSettings]
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [Array<(ExternalSettings, Integer, Hash)>] ExternalSettings data, response status code and response headers
166
+ def replace_with_http_info(app_id, external_settings, opts = {})
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug 'Calling API: SettingsApi.replace ...'
169
+ end
170
+ # verify the required parameter 'app_id' is set
171
+ if @api_client.config.client_side_validation && app_id.nil?
172
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling SettingsApi.replace"
173
+ end
174
+ # verify the required parameter 'external_settings' is set
175
+ if @api_client.config.client_side_validation && external_settings.nil?
176
+ fail ArgumentError, "Missing the required parameter 'external_settings' when calling SettingsApi.replace"
177
+ end
178
+ # resource path
179
+ local_var_path = '/crm/v3/extensions/videoconferencing/settings/{appId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))
180
+
181
+ # query parameters
182
+ query_params = opts[:query_params] || {}
183
+
184
+ # header parameters
185
+ header_params = opts[:header_params] || {}
186
+ # HTTP header 'Accept' (if needed)
187
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
188
+ # HTTP header 'Content-Type'
189
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
190
+
191
+ # form parameters
192
+ form_params = opts[:form_params] || {}
193
+
194
+ # http body (model)
195
+ post_body = opts[:body] || @api_client.object_to_http_body(external_settings)
196
+
197
+ # return_type
198
+ return_type = opts[:return_type] || 'ExternalSettings'
199
+
200
+ # auth_names
201
+ auth_names = opts[:auth_names] || ['hapikey']
202
+
203
+ new_options = opts.merge(
204
+ :header_params => header_params,
205
+ :query_params => query_params,
206
+ :form_params => form_params,
207
+ :body => post_body,
208
+ :auth_names => auth_names,
209
+ :return_type => return_type
210
+ )
211
+
212
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug "API called: SettingsApi#replace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
215
+ end
216
+ return data, status_code, headers
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,408 @@
1
+ =begin
2
+ #Video Conference Extension
3
+
4
+ #These APIs allow you to specify URLs that can be used to interact with a video conferencing application, to allow HubSpot to add video conference links to meeting requests with contacts.
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 Crm
21
+ module Extensions
22
+ module Videoconferencing
23
+ class ApiClient
24
+ # The Configuration object holding settings to be used in the API client.
25
+ attr_accessor :config
26
+
27
+ # Defines the headers to be used in HTTP requests of all API calls by default.
28
+ #
29
+ # @return [Hash]
30
+ attr_accessor :default_headers
31
+
32
+ # Initializes the ApiClient
33
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
34
+ def initialize(config = Configuration.default)
35
+ @config = config
36
+ @user_agent = "hubspot-api-client-ruby; #{VERSION}"
37
+ @default_headers = {
38
+ 'Content-Type' => 'application/json',
39
+ 'User-Agent' => @user_agent
40
+ }
41
+ end
42
+
43
+ def self.default
44
+ @@default ||= ApiClient.new
45
+ end
46
+
47
+ # Call an API with given options.
48
+ #
49
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
50
+ # the data deserialized from response body (could be nil), response status code and response headers.
51
+ def call_api(http_method, path, opts = {})
52
+ request = build_request(http_method, path, opts)
53
+ response = request.run
54
+
55
+ if @config.debugging
56
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
57
+ end
58
+
59
+ unless response.success?
60
+ if config.error_handler.any?
61
+ config.error_handler.each do |statuses, opts|
62
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
63
+
64
+ retries = opts[:max_retries] || 5
65
+ while retries > 0 && statuses.include?(response.code)
66
+ sleep opts[:seconds_delay] if opts[:seconds_delay]
67
+ response = request.run
68
+ opts[:retry_block].call if opts[:retry_block]
69
+ retries -= 1
70
+ end
71
+ end
72
+ end
73
+
74
+ if response.timed_out?
75
+ fail ApiError.new('Connection timed out')
76
+ elsif response.code == 0
77
+ # Errors from libcurl will be made visible here
78
+ fail ApiError.new(:code => 0,
79
+ :message => response.return_message)
80
+ else
81
+ fail ApiError.new(:code => response.code,
82
+ :response_headers => response.headers,
83
+ :response_body => response.body),
84
+ response.status_message
85
+ end
86
+ end
87
+
88
+ if opts[:return_type]
89
+ data = deserialize(response, opts[:return_type])
90
+ else
91
+ data = nil
92
+ end
93
+ return data, response.code, response.headers
94
+ end
95
+
96
+ # Builds the HTTP request
97
+ #
98
+ # @param [String] http_method HTTP method/verb (e.g. POST)
99
+ # @param [String] path URL path (e.g. /account/new)
100
+ # @option opts [Hash] :header_params Header parameters
101
+ # @option opts [Hash] :query_params Query parameters
102
+ # @option opts [Hash] :form_params Query parameters
103
+ # @option opts [Object] :body HTTP body (JSON/XML)
104
+ # @return [Typhoeus::Request] A Typhoeus Request
105
+ def build_request(http_method, path, opts = {})
106
+ url = build_request_url(path)
107
+ http_method = http_method.to_sym.downcase
108
+
109
+ header_params = @default_headers.merge(opts[:header_params] || {})
110
+ query_params = opts[:query_params] || {}
111
+ form_params = opts[:form_params] || {}
112
+
113
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
114
+
115
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
116
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
117
+
118
+ req_opts = {
119
+ :method => http_method,
120
+ :headers => header_params,
121
+ :params => query_params,
122
+ :params_encoding => @config.params_encoding,
123
+ :timeout => @config.timeout,
124
+ :ssl_verifypeer => @config.verify_ssl,
125
+ :ssl_verifyhost => _verify_ssl_host,
126
+ :sslcert => @config.cert_file,
127
+ :sslkey => @config.key_file,
128
+ :verbose => @config.debugging
129
+ }
130
+
131
+ # set custom cert, if provided
132
+ req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
133
+
134
+ if [:post, :patch, :put, :delete].include?(http_method)
135
+ req_body = build_request_body(header_params, form_params, opts[:body])
136
+ req_opts.update :body => req_body
137
+ if @config.debugging
138
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
139
+ end
140
+ end
141
+
142
+ request = Typhoeus::Request.new(url, req_opts)
143
+ download_file(request) if opts[:return_type] == 'File'
144
+ request
145
+ end
146
+
147
+ # Builds the HTTP request body
148
+ #
149
+ # @param [Hash] header_params Header parameters
150
+ # @param [Hash] form_params Query parameters
151
+ # @param [Object] body HTTP body (JSON/XML)
152
+ # @return [String] HTTP body data in the form of string
153
+ def build_request_body(header_params, form_params, body)
154
+ # http form
155
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
156
+ header_params['Content-Type'] == 'multipart/form-data'
157
+ data = {}
158
+ form_params.each do |key, value|
159
+ case value
160
+ when ::File, ::Array, nil
161
+ # let typhoeus handle File, Array and nil parameters
162
+ data[key] = value
163
+ else
164
+ data[key] = value.to_s
165
+ end
166
+ end
167
+ elsif body
168
+ data = body.is_a?(String) ? body : body.to_json
169
+ else
170
+ data = nil
171
+ end
172
+ data
173
+ end
174
+
175
+ # Check if the given MIME is a JSON MIME.
176
+ # JSON MIME examples:
177
+ # application/json
178
+ # application/json; charset=UTF8
179
+ # APPLICATION/JSON
180
+ # */*
181
+ # @param [String] mime MIME
182
+ # @return [Boolean] True if the MIME is application/json
183
+ def json_mime?(mime)
184
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
185
+ end
186
+
187
+ # Deserialize the response to the given return type.
188
+ #
189
+ # @param [Response] response HTTP response
190
+ # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
191
+ def deserialize(response, return_type)
192
+ body = response.body
193
+
194
+ # handle file downloading - return the File instance processed in request callbacks
195
+ # note that response body is empty when the file is written in chunks in request on_body callback
196
+ return @tempfile if return_type == 'File'
197
+
198
+ return nil if body.nil? || body.empty?
199
+
200
+ # return response body directly for String return type
201
+ return body if return_type == 'String'
202
+
203
+ # ensuring a default content type
204
+ content_type = response.headers['Content-Type'] || 'application/json'
205
+
206
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
207
+
208
+ begin
209
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
210
+ rescue JSON::ParserError => e
211
+ if %w(String Date DateTime).include?(return_type)
212
+ data = body
213
+ else
214
+ raise e
215
+ end
216
+ end
217
+
218
+ convert_to_type data, return_type
219
+ end
220
+
221
+ # Convert data to the given return type.
222
+ # @param [Object] data Data to be converted
223
+ # @param [String] return_type Return type
224
+ # @return [Mixed] Data in a particular type
225
+ def convert_to_type(data, return_type)
226
+ return nil if data.nil?
227
+ case return_type
228
+ when 'String'
229
+ data.to_s
230
+ when 'Integer'
231
+ data.to_i
232
+ when 'Float'
233
+ data.to_f
234
+ when 'Boolean'
235
+ data == true
236
+ when 'DateTime'
237
+ # parse date time (expecting ISO 8601 format)
238
+ DateTime.parse data
239
+ when 'Date'
240
+ # parse date time (expecting ISO 8601 format)
241
+ Date.parse data
242
+ when 'Object'
243
+ # generic object (usually a Hash), return directly
244
+ data
245
+ when /\AArray<(.+)>\z/
246
+ # e.g. Array<Pet>
247
+ sub_type = $1
248
+ data.map { |item| convert_to_type(item, sub_type) }
249
+ when /\AHash\<String, (.+)\>\z/
250
+ # e.g. Hash<String, Integer>
251
+ sub_type = $1
252
+ {}.tap do |hash|
253
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
254
+ end
255
+ else
256
+ # models, e.g. Pet
257
+ Hubspot::Crm::Extensions::Videoconferencing.const_get(return_type).build_from_hash(data)
258
+ end
259
+ end
260
+
261
+ # Save response body into a file in (the defined) temporary folder, using the filename
262
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
263
+ # The response body is written to the file in chunks in order to handle files which
264
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
265
+ # process can use.
266
+ #
267
+ # @see Configuration#temp_folder_path
268
+ def download_file(request)
269
+ tempfile = nil
270
+ encoding = nil
271
+ request.on_headers do |response|
272
+ content_disposition = response.headers['Content-Disposition']
273
+ if content_disposition && content_disposition =~ /filename=/i
274
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
275
+ prefix = sanitize_filename(filename)
276
+ else
277
+ prefix = 'download-'
278
+ end
279
+ prefix = prefix + '-' unless prefix.end_with?('-')
280
+ encoding = response.body.encoding
281
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
282
+ @tempfile = tempfile
283
+ end
284
+ request.on_body do |chunk|
285
+ chunk.force_encoding(encoding)
286
+ tempfile.write(chunk)
287
+ end
288
+ request.on_complete do |response|
289
+ if tempfile
290
+ tempfile.close
291
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
292
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
293
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
294
+ "explicitly with `tempfile.delete`"
295
+ end
296
+ end
297
+ end
298
+
299
+ # Sanitize filename by removing path.
300
+ # e.g. ../../sun.gif becomes sun.gif
301
+ #
302
+ # @param [String] filename the filename to be sanitized
303
+ # @return [String] the sanitized filename
304
+ def sanitize_filename(filename)
305
+ filename.gsub(/.*[\/\\]/, '')
306
+ end
307
+
308
+ def build_request_url(path)
309
+ # Add leading and trailing slashes to path
310
+ path = "/#{path}".gsub(/\/+/, '/')
311
+ @config.base_url + path
312
+ end
313
+
314
+ # Update hearder and query params based on authentication settings.
315
+ #
316
+ # @param [Hash] header_params Header parameters
317
+ # @param [Hash] query_params Query parameters
318
+ # @param [String] auth_names Authentication scheme name
319
+ def update_params_for_auth!(header_params, query_params, auth_names)
320
+ Array(auth_names).each do |auth_name|
321
+ auth_setting = @config.auth_settings[auth_name]
322
+ next unless auth_setting
323
+ case auth_setting[:in]
324
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
325
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
326
+ else fail ArgumentError, 'Authentication token must be in `query` of `header`'
327
+ end
328
+ end
329
+ end
330
+
331
+ # Sets user agent in HTTP header
332
+ #
333
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
334
+ def user_agent=(user_agent)
335
+ @user_agent = user_agent
336
+ @default_headers['User-Agent'] = @user_agent
337
+ end
338
+
339
+ # Return Accept header based on an array of accepts provided.
340
+ # @param [Array] accepts array for Accept
341
+ # @return [String] the Accept header (e.g. application/json)
342
+ def select_header_accept(accepts)
343
+ return nil if accepts.nil? || accepts.empty?
344
+ # use JSON when present, otherwise use all of the provided
345
+ json_accept = accepts.find { |s| json_mime?(s) }
346
+ json_accept || accepts.join(',')
347
+ end
348
+
349
+ # Return Content-Type header based on an array of content types provided.
350
+ # @param [Array] content_types array for Content-Type
351
+ # @return [String] the Content-Type header (e.g. application/json)
352
+ def select_header_content_type(content_types)
353
+ # use application/json by default
354
+ return 'application/json' if content_types.nil? || content_types.empty?
355
+ # use JSON when present, otherwise use the first one
356
+ json_content_type = content_types.find { |s| json_mime?(s) }
357
+ json_content_type || content_types.first
358
+ end
359
+
360
+ # Convert object (array, hash, object, etc) to JSON string.
361
+ # @param [Object] model object to be converted into JSON string
362
+ # @return [String] JSON string representation of the object
363
+ def object_to_http_body(model)
364
+ return model if model.nil? || model.is_a?(String)
365
+ local_body = nil
366
+ if model.is_a?(Array)
367
+ local_body = model.map { |m| object_to_hash(m) }
368
+ else
369
+ local_body = object_to_hash(model)
370
+ end
371
+ local_body.to_json
372
+ end
373
+
374
+ # Convert object(non-array) to hash.
375
+ # @param [Object] obj object to be converted into JSON string
376
+ # @return [String] JSON string representation of the object
377
+ def object_to_hash(obj)
378
+ if obj.respond_to?(:to_hash)
379
+ obj.to_hash
380
+ else
381
+ obj
382
+ end
383
+ end
384
+
385
+ # Build parameter value according to the given collection format.
386
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
387
+ def build_collection_param(param, collection_format)
388
+ case collection_format
389
+ when :csv
390
+ param.join(',')
391
+ when :ssv
392
+ param.join(' ')
393
+ when :tsv
394
+ param.join("\t")
395
+ when :pipes
396
+ param.join('|')
397
+ when :multi
398
+ # return the array directly as typhoeus will handle it as expected
399
+ param
400
+ else
401
+ fail "unknown collection format: #{collection_format.inspect}"
402
+ end
403
+ end
404
+ end
405
+ end
406
+ end
407
+ end
408
+ end