hubspot-api-client 1.0.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (632) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -23
  3. data/lib/hubspot-api-client.rb +1 -1
  4. data/lib/hubspot/codegen/crm/associations/api/batch_api.rb +222 -226
  5. data/lib/hubspot/codegen/crm/associations/api_client.rb +349 -351
  6. data/lib/hubspot/codegen/crm/associations/api_error.rb +35 -37
  7. data/lib/hubspot/codegen/crm/associations/configuration.rb +221 -223
  8. data/lib/hubspot/codegen/crm/associations/models/batch_input_public_association.rb +174 -178
  9. data/lib/hubspot/codegen/crm/associations/models/batch_input_public_object_id.rb +174 -178
  10. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association.rb +262 -266
  11. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association_multi.rb +262 -266
  12. data/lib/hubspot/codegen/crm/associations/models/error.rb +229 -233
  13. data/lib/hubspot/codegen/crm/associations/models/error_detail.rb +210 -214
  14. data/lib/hubspot/codegen/crm/associations/models/public_association.rb +184 -188
  15. data/lib/hubspot/codegen/crm/associations/models/public_association_multi.rb +186 -190
  16. data/lib/hubspot/codegen/crm/associations/models/public_object_id.rb +173 -177
  17. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +216 -220
  18. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +338 -340
  19. data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +249 -253
  20. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +66 -70
  21. data/lib/hubspot/codegen/crm/companies/api_client.rb +349 -351
  22. data/lib/hubspot/codegen/crm/companies/api_error.rb +35 -37
  23. data/lib/hubspot/codegen/crm/companies/configuration.rb +221 -223
  24. data/lib/hubspot/codegen/crm/companies/models/batch_input_simple_public_object_batch_input.rb +174 -178
  25. data/lib/hubspot/codegen/crm/companies/models/batch_input_simple_public_object_id.rb +174 -178
  26. data/lib/hubspot/codegen/crm/companies/models/batch_input_simple_public_object_input.rb +174 -178
  27. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +188 -192
  28. data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object.rb +261 -265
  29. data/lib/hubspot/codegen/crm/companies/models/collection_response_simple_public_object.rb +182 -186
  30. data/lib/hubspot/codegen/crm/companies/models/collection_response_simple_public_object_id.rb +182 -186
  31. data/lib/hubspot/codegen/crm/companies/models/collection_response_with_total_simple_public_object.rb +195 -199
  32. data/lib/hubspot/codegen/crm/companies/models/error.rb +229 -233
  33. data/lib/hubspot/codegen/crm/companies/models/error_detail.rb +210 -214
  34. data/lib/hubspot/codegen/crm/companies/models/filter.rb +219 -223
  35. data/lib/hubspot/codegen/crm/companies/models/filter_group.rb +174 -178
  36. data/lib/hubspot/codegen/crm/companies/models/next_page.rb +180 -184
  37. data/lib/hubspot/codegen/crm/companies/models/paging.rb +168 -172
  38. data/lib/hubspot/codegen/crm/companies/models/public_object_search_request.rb +227 -231
  39. data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +235 -239
  40. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_batch_input.rb +185 -189
  41. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_id.rb +172 -176
  42. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input.rb +174 -178
  43. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +216 -220
  44. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +338 -340
  45. data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +249 -253
  46. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +66 -70
  47. data/lib/hubspot/codegen/crm/contacts/api_client.rb +349 -351
  48. data/lib/hubspot/codegen/crm/contacts/api_error.rb +35 -37
  49. data/lib/hubspot/codegen/crm/contacts/configuration.rb +221 -223
  50. data/lib/hubspot/codegen/crm/contacts/models/batch_input_simple_public_object_batch_input.rb +174 -178
  51. data/lib/hubspot/codegen/crm/contacts/models/batch_input_simple_public_object_id.rb +174 -178
  52. data/lib/hubspot/codegen/crm/contacts/models/batch_input_simple_public_object_input.rb +174 -178
  53. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +188 -192
  54. data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object.rb +261 -265
  55. data/lib/hubspot/codegen/crm/contacts/models/collection_response_simple_public_object.rb +182 -186
  56. data/lib/hubspot/codegen/crm/contacts/models/collection_response_simple_public_object_id.rb +182 -186
  57. data/lib/hubspot/codegen/crm/contacts/models/collection_response_with_total_simple_public_object.rb +195 -199
  58. data/lib/hubspot/codegen/crm/contacts/models/error.rb +229 -233
  59. data/lib/hubspot/codegen/crm/contacts/models/error_detail.rb +210 -214
  60. data/lib/hubspot/codegen/crm/contacts/models/filter.rb +219 -223
  61. data/lib/hubspot/codegen/crm/contacts/models/filter_group.rb +174 -178
  62. data/lib/hubspot/codegen/crm/contacts/models/next_page.rb +180 -184
  63. data/lib/hubspot/codegen/crm/contacts/models/paging.rb +168 -172
  64. data/lib/hubspot/codegen/crm/contacts/models/public_object_search_request.rb +227 -231
  65. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +235 -239
  66. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_batch_input.rb +185 -189
  67. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_id.rb +172 -176
  68. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_input.rb +174 -178
  69. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +216 -220
  70. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +338 -340
  71. data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +249 -253
  72. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +66 -70
  73. data/lib/hubspot/codegen/crm/deals/api_client.rb +349 -351
  74. data/lib/hubspot/codegen/crm/deals/api_error.rb +35 -37
  75. data/lib/hubspot/codegen/crm/deals/configuration.rb +221 -223
  76. data/lib/hubspot/codegen/crm/deals/models/batch_input_simple_public_object_batch_input.rb +174 -178
  77. data/lib/hubspot/codegen/crm/deals/models/batch_input_simple_public_object_id.rb +174 -178
  78. data/lib/hubspot/codegen/crm/deals/models/batch_input_simple_public_object_input.rb +174 -178
  79. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +188 -192
  80. data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object.rb +261 -265
  81. data/lib/hubspot/codegen/crm/deals/models/collection_response_simple_public_object.rb +182 -186
  82. data/lib/hubspot/codegen/crm/deals/models/collection_response_simple_public_object_id.rb +182 -186
  83. data/lib/hubspot/codegen/crm/deals/models/collection_response_with_total_simple_public_object.rb +195 -199
  84. data/lib/hubspot/codegen/crm/deals/models/error.rb +229 -233
  85. data/lib/hubspot/codegen/crm/deals/models/error_detail.rb +210 -214
  86. data/lib/hubspot/codegen/crm/deals/models/filter.rb +219 -223
  87. data/lib/hubspot/codegen/crm/deals/models/filter_group.rb +174 -178
  88. data/lib/hubspot/codegen/crm/deals/models/next_page.rb +180 -184
  89. data/lib/hubspot/codegen/crm/deals/models/paging.rb +168 -172
  90. data/lib/hubspot/codegen/crm/deals/models/public_object_search_request.rb +227 -231
  91. data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +235 -239
  92. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_batch_input.rb +185 -189
  93. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_id.rb +172 -176
  94. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_input.rb +174 -178
  95. data/lib/hubspot/codegen/crm/extensions/cards/api/cards_api.rb +342 -316
  96. data/lib/hubspot/codegen/crm/extensions/cards/api/sample_response_api.rb +84 -0
  97. data/lib/hubspot/codegen/crm/extensions/cards/api_client.rb +350 -352
  98. data/lib/hubspot/codegen/crm/extensions/cards/api_error.rb +36 -38
  99. data/lib/hubspot/codegen/crm/extensions/cards/configuration.rb +222 -224
  100. data/lib/hubspot/codegen/crm/extensions/cards/models/action_confirmation_body.rb +245 -0
  101. data/lib/hubspot/codegen/crm/extensions/cards/models/action_hook_action_body.rb +327 -0
  102. data/lib/hubspot/codegen/crm/extensions/cards/models/card_actions.rb +175 -179
  103. data/lib/hubspot/codegen/crm/extensions/cards/models/card_create_request.rb +208 -212
  104. data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_body.rb +175 -179
  105. data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_property.rb +237 -241
  106. data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body.rb +186 -190
  107. data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body_patch.rb +182 -186
  108. data/lib/hubspot/codegen/crm/extensions/cards/models/card_list_response.rb +175 -179
  109. data/lib/hubspot/codegen/crm/extensions/cards/models/card_object_type_body.rb +214 -218
  110. data/lib/hubspot/codegen/crm/extensions/cards/models/card_patch_request.rb +193 -197
  111. data/lib/hubspot/codegen/crm/extensions/cards/models/card_response.rb +228 -232
  112. data/lib/hubspot/codegen/crm/extensions/cards/models/display_option.rb +224 -228
  113. data/lib/hubspot/codegen/crm/extensions/cards/models/error.rb +230 -234
  114. data/lib/hubspot/codegen/crm/extensions/cards/models/error_detail.rb +193 -197
  115. data/lib/hubspot/codegen/crm/extensions/cards/models/i_frame_action_body.rb +320 -0
  116. data/lib/hubspot/codegen/crm/extensions/cards/models/integrator_card_payload_response.rb +303 -0
  117. data/lib/hubspot/codegen/crm/extensions/cards/models/integrator_object_result.rb +272 -0
  118. data/lib/hubspot/codegen/crm/extensions/cards/models/object_token.rb +278 -0
  119. data/lib/hubspot/codegen/crm/extensions/cards/models/top_level_actions.rb +237 -0
  120. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +216 -220
  121. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +338 -340
  122. data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +249 -253
  123. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +66 -70
  124. data/lib/hubspot/codegen/crm/line_items/api_client.rb +349 -351
  125. data/lib/hubspot/codegen/crm/line_items/api_error.rb +35 -37
  126. data/lib/hubspot/codegen/crm/line_items/configuration.rb +221 -223
  127. data/lib/hubspot/codegen/crm/line_items/models/batch_input_simple_public_object_batch_input.rb +174 -178
  128. data/lib/hubspot/codegen/crm/line_items/models/batch_input_simple_public_object_id.rb +174 -178
  129. data/lib/hubspot/codegen/crm/line_items/models/batch_input_simple_public_object_input.rb +174 -178
  130. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +188 -192
  131. data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object.rb +261 -265
  132. data/lib/hubspot/codegen/crm/line_items/models/collection_response_simple_public_object.rb +182 -186
  133. data/lib/hubspot/codegen/crm/line_items/models/collection_response_simple_public_object_id.rb +182 -186
  134. data/lib/hubspot/codegen/crm/line_items/models/collection_response_with_total_simple_public_object.rb +195 -199
  135. data/lib/hubspot/codegen/crm/line_items/models/error.rb +229 -233
  136. data/lib/hubspot/codegen/crm/line_items/models/error_detail.rb +210 -214
  137. data/lib/hubspot/codegen/crm/line_items/models/filter.rb +219 -223
  138. data/lib/hubspot/codegen/crm/line_items/models/filter_group.rb +174 -178
  139. data/lib/hubspot/codegen/crm/line_items/models/next_page.rb +180 -184
  140. data/lib/hubspot/codegen/crm/line_items/models/paging.rb +168 -172
  141. data/lib/hubspot/codegen/crm/line_items/models/public_object_search_request.rb +227 -231
  142. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object.rb +235 -239
  143. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_batch_input.rb +185 -189
  144. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_id.rb +172 -176
  145. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_input.rb +174 -178
  146. data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +233 -237
  147. data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +368 -369
  148. data/lib/hubspot/codegen/crm/objects/api/batch_api.rb +273 -277
  149. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +72 -76
  150. data/lib/hubspot/codegen/crm/objects/api_client.rb +349 -351
  151. data/lib/hubspot/codegen/crm/objects/api_error.rb +35 -37
  152. data/lib/hubspot/codegen/crm/objects/configuration.rb +220 -222
  153. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_batch_input.rb +174 -178
  154. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_id.rb +174 -178
  155. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_input.rb +174 -178
  156. data/lib/hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id.rb +196 -191
  157. data/lib/hubspot/codegen/crm/objects/models/batch_response_simple_public_object.rb +261 -265
  158. data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object.rb +182 -186
  159. data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object_id.rb +182 -186
  160. data/lib/hubspot/codegen/crm/objects/models/collection_response_with_total_simple_public_object.rb +195 -199
  161. data/lib/hubspot/codegen/crm/objects/models/error.rb +229 -233
  162. data/lib/hubspot/codegen/crm/objects/models/error_detail.rb +210 -214
  163. data/lib/hubspot/codegen/crm/objects/models/filter.rb +219 -223
  164. data/lib/hubspot/codegen/crm/objects/models/filter_group.rb +174 -178
  165. data/lib/hubspot/codegen/crm/objects/models/next_page.rb +180 -184
  166. data/lib/hubspot/codegen/crm/objects/models/paging.rb +168 -172
  167. data/lib/hubspot/codegen/crm/objects/models/public_object_search_request.rb +227 -231
  168. data/lib/hubspot/codegen/crm/objects/models/simple_public_object.rb +235 -239
  169. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_batch_input.rb +185 -189
  170. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_id.rb +172 -176
  171. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_input.rb +174 -178
  172. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +138 -140
  173. data/lib/hubspot/codegen/crm/owners/api_client.rb +349 -351
  174. data/lib/hubspot/codegen/crm/owners/api_error.rb +35 -37
  175. data/lib/hubspot/codegen/crm/owners/configuration.rb +220 -222
  176. data/lib/hubspot/codegen/crm/owners/models/collection_response_public_owner.rb +182 -186
  177. data/lib/hubspot/codegen/crm/owners/models/error.rb +229 -233
  178. data/lib/hubspot/codegen/crm/owners/models/error_detail.rb +192 -196
  179. data/lib/hubspot/codegen/crm/owners/models/next_page.rb +180 -184
  180. data/lib/hubspot/codegen/crm/owners/models/paging.rb +168 -172
  181. data/lib/hubspot/codegen/crm/owners/models/public_owner.rb +242 -246
  182. data/lib/hubspot/codegen/crm/owners/models/public_team.rb +219 -223
  183. data/lib/hubspot/codegen/crm/pipelines/api/pipeline_stages_api.rb +458 -462
  184. data/lib/hubspot/codegen/crm/pipelines/api/pipelines_api.rb +422 -426
  185. data/lib/hubspot/codegen/crm/pipelines/api_client.rb +349 -351
  186. data/lib/hubspot/codegen/crm/pipelines/api_error.rb +35 -37
  187. data/lib/hubspot/codegen/crm/pipelines/configuration.rb +220 -222
  188. data/lib/hubspot/codegen/crm/pipelines/models/collection_response_pipeline.rb +182 -186
  189. data/lib/hubspot/codegen/crm/pipelines/models/collection_response_pipeline_stage.rb +182 -186
  190. data/lib/hubspot/codegen/crm/pipelines/models/error.rb +229 -254
  191. data/lib/hubspot/codegen/crm/pipelines/models/error_detail.rb +192 -196
  192. data/lib/hubspot/codegen/crm/pipelines/models/next_page.rb +180 -184
  193. data/lib/hubspot/codegen/crm/pipelines/models/paging.rb +168 -172
  194. data/lib/hubspot/codegen/crm/pipelines/models/pipeline.rb +262 -266
  195. data/lib/hubspot/codegen/crm/pipelines/models/pipeline_input.rb +203 -207
  196. data/lib/hubspot/codegen/crm/pipelines/models/pipeline_patch_input.rb +188 -192
  197. data/lib/hubspot/codegen/crm/pipelines/models/pipeline_stage.rb +261 -265
  198. data/lib/hubspot/codegen/crm/pipelines/models/pipeline_stage_input.rb +201 -205
  199. data/lib/hubspot/codegen/crm/pipelines/models/pipeline_stage_patch_input.rb +202 -206
  200. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +215 -219
  201. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +337 -339
  202. data/lib/hubspot/codegen/crm/products/api/batch_api.rb +248 -252
  203. data/lib/hubspot/codegen/crm/products/api/search_api.rb +65 -69
  204. data/lib/hubspot/codegen/crm/products/api_client.rb +349 -351
  205. data/lib/hubspot/codegen/crm/products/api_error.rb +35 -37
  206. data/lib/hubspot/codegen/crm/products/configuration.rb +220 -222
  207. data/lib/hubspot/codegen/crm/products/models/batch_input_simple_public_object_batch_input.rb +174 -178
  208. data/lib/hubspot/codegen/crm/products/models/batch_input_simple_public_object_id.rb +174 -178
  209. data/lib/hubspot/codegen/crm/products/models/batch_input_simple_public_object_input.rb +174 -178
  210. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +188 -192
  211. data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object.rb +261 -265
  212. data/lib/hubspot/codegen/crm/products/models/collection_response_simple_public_object.rb +182 -186
  213. data/lib/hubspot/codegen/crm/products/models/collection_response_simple_public_object_id.rb +182 -186
  214. data/lib/hubspot/codegen/crm/products/models/collection_response_with_total_simple_public_object.rb +195 -199
  215. data/lib/hubspot/codegen/crm/products/models/error.rb +229 -233
  216. data/lib/hubspot/codegen/crm/products/models/error_detail.rb +210 -214
  217. data/lib/hubspot/codegen/crm/products/models/filter.rb +219 -223
  218. data/lib/hubspot/codegen/crm/products/models/filter_group.rb +174 -178
  219. data/lib/hubspot/codegen/crm/products/models/next_page.rb +180 -184
  220. data/lib/hubspot/codegen/crm/products/models/paging.rb +168 -172
  221. data/lib/hubspot/codegen/crm/products/models/public_object_search_request.rb +227 -231
  222. data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +235 -239
  223. data/lib/hubspot/codegen/crm/products/models/simple_public_object_batch_input.rb +185 -189
  224. data/lib/hubspot/codegen/crm/products/models/simple_public_object_id.rb +172 -176
  225. data/lib/hubspot/codegen/crm/products/models/simple_public_object_input.rb +174 -178
  226. data/lib/hubspot/codegen/crm/properties/api/batch_api.rb +203 -207
  227. data/lib/hubspot/codegen/crm/properties/api/core_api.rb +347 -351
  228. data/lib/hubspot/codegen/crm/properties/api/groups_api.rb +341 -345
  229. data/lib/hubspot/codegen/crm/properties/api_client.rb +349 -351
  230. data/lib/hubspot/codegen/crm/properties/api_error.rb +35 -37
  231. data/lib/hubspot/codegen/crm/properties/configuration.rb +220 -222
  232. data/lib/hubspot/codegen/crm/properties/models/batch_input_property_create.rb +174 -178
  233. data/lib/hubspot/codegen/crm/properties/models/batch_input_property_name.rb +174 -178
  234. data/lib/hubspot/codegen/crm/properties/models/batch_read_input_property_name.rb +185 -189
  235. data/lib/hubspot/codegen/crm/properties/models/batch_response_property.rb +261 -265
  236. data/lib/hubspot/codegen/crm/properties/models/collection_response_property.rb +182 -186
  237. data/lib/hubspot/codegen/crm/properties/models/collection_response_property_group.rb +182 -186
  238. data/lib/hubspot/codegen/crm/properties/models/error.rb +229 -233
  239. data/lib/hubspot/codegen/crm/properties/models/error_detail.rb +210 -214
  240. data/lib/hubspot/codegen/crm/properties/models/next_page.rb +180 -184
  241. data/lib/hubspot/codegen/crm/properties/models/option.rb +215 -219
  242. data/lib/hubspot/codegen/crm/properties/models/option_input.rb +215 -219
  243. data/lib/hubspot/codegen/crm/properties/models/paging.rb +168 -172
  244. data/lib/hubspot/codegen/crm/properties/models/property.rb +393 -397
  245. data/lib/hubspot/codegen/crm/properties/models/property_create.rb +309 -313
  246. data/lib/hubspot/codegen/crm/properties/models/property_group.rb +210 -214
  247. data/lib/hubspot/codegen/crm/properties/models/property_group_create.rb +195 -199
  248. data/lib/hubspot/codegen/crm/properties/models/property_group_update.rb +178 -182
  249. data/lib/hubspot/codegen/crm/properties/models/property_modification_metadata.rb +203 -207
  250. data/lib/hubspot/codegen/crm/properties/models/property_name.rb +173 -177
  251. data/lib/hubspot/codegen/crm/properties/models/property_update.rb +271 -275
  252. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +215 -219
  253. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +337 -339
  254. data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +248 -252
  255. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +65 -69
  256. data/lib/hubspot/codegen/crm/quotes/api_client.rb +349 -351
  257. data/lib/hubspot/codegen/crm/quotes/api_error.rb +35 -37
  258. data/lib/hubspot/codegen/crm/quotes/configuration.rb +220 -222
  259. data/lib/hubspot/codegen/crm/quotes/models/batch_input_simple_public_object_batch_input.rb +174 -178
  260. data/lib/hubspot/codegen/crm/quotes/models/batch_input_simple_public_object_id.rb +174 -178
  261. data/lib/hubspot/codegen/crm/quotes/models/batch_input_simple_public_object_input.rb +174 -178
  262. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +188 -192
  263. data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object.rb +261 -265
  264. data/lib/hubspot/codegen/crm/quotes/models/collection_response_simple_public_object.rb +182 -186
  265. data/lib/hubspot/codegen/crm/quotes/models/collection_response_simple_public_object_id.rb +182 -186
  266. data/lib/hubspot/codegen/crm/quotes/models/collection_response_with_total_simple_public_object.rb +195 -199
  267. data/lib/hubspot/codegen/crm/quotes/models/error.rb +229 -233
  268. data/lib/hubspot/codegen/crm/quotes/models/error_detail.rb +210 -214
  269. data/lib/hubspot/codegen/crm/quotes/models/filter.rb +220 -224
  270. data/lib/hubspot/codegen/crm/quotes/models/filter_group.rb +174 -178
  271. data/lib/hubspot/codegen/crm/quotes/models/next_page.rb +181 -185
  272. data/lib/hubspot/codegen/crm/quotes/models/paging.rb +169 -173
  273. data/lib/hubspot/codegen/crm/quotes/models/public_object_search_request.rb +228 -232
  274. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object.rb +236 -240
  275. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_batch_input.rb +186 -190
  276. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_id.rb +173 -177
  277. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_input.rb +175 -179
  278. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +216 -220
  279. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +338 -340
  280. data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +249 -253
  281. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +66 -70
  282. data/lib/hubspot/codegen/crm/tickets/api_client.rb +350 -352
  283. data/lib/hubspot/codegen/crm/tickets/api_error.rb +36 -38
  284. data/lib/hubspot/codegen/crm/tickets/configuration.rb +220 -222
  285. data/lib/hubspot/codegen/crm/tickets/models/batch_input_simple_public_object_batch_input.rb +175 -179
  286. data/lib/hubspot/codegen/crm/tickets/models/batch_input_simple_public_object_id.rb +175 -179
  287. data/lib/hubspot/codegen/crm/tickets/models/batch_input_simple_public_object_input.rb +175 -179
  288. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +189 -193
  289. data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object.rb +262 -266
  290. data/lib/hubspot/codegen/crm/tickets/models/collection_response_simple_public_object.rb +183 -187
  291. data/lib/hubspot/codegen/crm/tickets/models/collection_response_simple_public_object_id.rb +183 -187
  292. data/lib/hubspot/codegen/crm/tickets/models/collection_response_with_total_simple_public_object.rb +196 -200
  293. data/lib/hubspot/codegen/crm/tickets/models/error.rb +230 -234
  294. data/lib/hubspot/codegen/crm/tickets/models/error_detail.rb +211 -215
  295. data/lib/hubspot/codegen/crm/tickets/models/filter.rb +220 -224
  296. data/lib/hubspot/codegen/crm/tickets/models/filter_group.rb +175 -179
  297. data/lib/hubspot/codegen/crm/tickets/models/next_page.rb +181 -185
  298. data/lib/hubspot/codegen/crm/tickets/models/paging.rb +169 -173
  299. data/lib/hubspot/codegen/crm/tickets/models/public_object_search_request.rb +228 -232
  300. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +236 -240
  301. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_batch_input.rb +186 -190
  302. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_id.rb +172 -176
  303. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_input.rb +174 -178
  304. data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +64 -68
  305. data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +316 -320
  306. data/lib/hubspot/codegen/oauth/api/tokens_api.rb +78 -82
  307. data/lib/hubspot/codegen/oauth/api_client.rb +350 -352
  308. data/lib/hubspot/codegen/oauth/api_error.rb +34 -36
  309. data/lib/hubspot/codegen/oauth/configuration.rb +219 -221
  310. data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +250 -254
  311. data/lib/hubspot/codegen/oauth/models/error.rb +245 -249
  312. data/lib/hubspot/codegen/oauth/models/error_detail.rb +191 -195
  313. data/lib/hubspot/codegen/oauth/models/json_node.rb +333 -337
  314. data/lib/hubspot/codegen/oauth/models/refresh_token.rb +206 -210
  315. data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +239 -243
  316. data/lib/hubspot/configuration.rb +1 -1
  317. data/lib/hubspot/helpers/get_all_helper.rb +27 -0
  318. data/lib/hubspot/{oauth.rb → oauth_helper.rb} +1 -1
  319. data/lib/hubspot/version.rb +1 -1
  320. data/sample-apps/companies-app/Gemfile +1 -1
  321. data/sample-apps/companies-app/Gemfile.lock +4 -3
  322. data/sample-apps/companies-app/app/controllers/companies_controller.rb +2 -2
  323. data/sample-apps/companies-app/app/controllers/contacts_controller.rb +1 -1
  324. data/sample-apps/companies-app/app/lib/services/authorization/get_authorization_uri.rb +1 -1
  325. data/sample-apps/companies-app/app/lib/services/authorization/tokens/generate.rb +1 -1
  326. data/sample-apps/companies-app/app/lib/services/authorization/tokens/refresh.rb +1 -1
  327. data/sample-apps/companies-app/app/lib/services/hubspot/associations/create.rb +5 -5
  328. data/sample-apps/companies-app/app/lib/services/hubspot/associations/delete.rb +5 -5
  329. data/sample-apps/companies-app/app/lib/services/hubspot/associations/get_by_id.rb +4 -4
  330. data/sample-apps/companies-app/app/lib/services/hubspot/companies/create.rb +2 -2
  331. data/sample-apps/companies-app/app/lib/services/hubspot/companies/destroy.rb +1 -1
  332. data/sample-apps/companies-app/app/lib/services/hubspot/companies/export.rb +1 -1
  333. data/sample-apps/companies-app/app/lib/services/hubspot/companies/get_all.rb +1 -1
  334. data/sample-apps/companies-app/app/lib/services/hubspot/companies/get_by_id.rb +1 -1
  335. data/sample-apps/companies-app/app/lib/services/hubspot/companies/search.rb +4 -4
  336. data/sample-apps/companies-app/app/lib/services/hubspot/companies/update.rb +2 -2
  337. data/sample-apps/{oauth-app/app/lib/services/hubspot/contacts/get_all.rb → companies-app/app/lib/services/hubspot/contacts/get_page.rb} +3 -3
  338. data/sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb +4 -4
  339. data/sample-apps/companies-app/app/views/oauth/authorization/login.html.erb +1 -1
  340. data/sample-apps/contacts-app/Gemfile +1 -1
  341. data/sample-apps/contacts-app/Gemfile.lock +4 -3
  342. data/sample-apps/contacts-app/app/controllers/contacts_controller.rb +3 -3
  343. data/sample-apps/contacts-app/app/controllers/properties_controller.rb +3 -3
  344. data/sample-apps/contacts-app/app/lib/services/authorization/get_authorization_uri.rb +1 -1
  345. data/sample-apps/contacts-app/app/lib/services/authorization/tokens/generate.rb +1 -1
  346. data/sample-apps/contacts-app/app/lib/services/authorization/tokens/refresh.rb +1 -1
  347. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/create.rb +2 -2
  348. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/destroy.rb +2 -2
  349. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/export.rb +2 -15
  350. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb +2 -2
  351. data/sample-apps/{companies-app/app/lib/services/hubspot/contacts/get_all.rb → contacts-app/app/lib/services/hubspot/contacts/get_page.rb} +3 -3
  352. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/search.rb +4 -4
  353. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/update.rb +2 -2
  354. data/sample-apps/contacts-app/app/lib/services/hubspot/owners/get_all.rb +1 -1
  355. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/create.rb +2 -2
  356. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/destroy.rb +1 -1
  357. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/get_all.rb +1 -1
  358. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/get_by_name.rb +1 -1
  359. data/sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb +3 -3
  360. data/sample-apps/contacts-app/app/views/oauth/authorization/login.html.erb +1 -1
  361. data/sample-apps/leaky-bucket-app/.env.template +3 -0
  362. data/sample-apps/leaky-bucket-app/.gitignore +34 -0
  363. data/sample-apps/leaky-bucket-app/.ruby-version +1 -0
  364. data/sample-apps/leaky-bucket-app/Dockerfile +22 -0
  365. data/sample-apps/leaky-bucket-app/Gemfile +39 -0
  366. data/sample-apps/leaky-bucket-app/Gemfile.lock +307 -0
  367. data/sample-apps/leaky-bucket-app/README.md +34 -0
  368. data/sample-apps/leaky-bucket-app/Rakefile +6 -0
  369. data/sample-apps/leaky-bucket-app/app/assets/config/manifest.js +3 -0
  370. data/sample-apps/leaky-bucket-app/app/assets/images/.keep +0 -0
  371. data/sample-apps/leaky-bucket-app/app/assets/javascripts/application.js +25 -0
  372. data/sample-apps/leaky-bucket-app/app/assets/javascripts/cable.js +13 -0
  373. data/sample-apps/leaky-bucket-app/app/assets/javascripts/channels/.keep +0 -0
  374. data/sample-apps/leaky-bucket-app/app/assets/stylesheets/application.css +90 -0
  375. data/sample-apps/leaky-bucket-app/app/controllers/application_controller.rb +12 -0
  376. data/sample-apps/leaky-bucket-app/app/controllers/concerns/.keep +0 -0
  377. data/sample-apps/leaky-bucket-app/app/controllers/concerns/exception_handler.rb +12 -0
  378. data/sample-apps/leaky-bucket-app/app/controllers/home_controller.rb +15 -0
  379. data/sample-apps/leaky-bucket-app/app/controllers/oauth/authorization_controller.rb +19 -0
  380. data/sample-apps/leaky-bucket-app/app/helpers/application_helper.rb +2 -0
  381. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
  382. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
  383. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/tokens/base.rb +19 -0
  384. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/tokens/generate.rb +26 -0
  385. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/tokens/refresh.rb +33 -0
  386. data/sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb +29 -0
  387. data/sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/create_batch.rb +37 -0
  388. data/sample-apps/leaky-bucket-app/app/models/application_record.rb +3 -0
  389. data/sample-apps/leaky-bucket-app/app/models/concerns/.keep +0 -0
  390. data/sample-apps/leaky-bucket-app/app/views/home/index.html.erb +13 -0
  391. data/sample-apps/leaky-bucket-app/app/views/layouts/application.html.erb +23 -0
  392. data/sample-apps/leaky-bucket-app/app/views/oauth/authorization/login.html.erb +15 -0
  393. data/sample-apps/leaky-bucket-app/app/views/shared/_header.html.erb +12 -0
  394. data/sample-apps/leaky-bucket-app/app/workers/leaky_bucket_worker.rb +25 -0
  395. data/sample-apps/leaky-bucket-app/bin/bundle +3 -0
  396. data/sample-apps/leaky-bucket-app/bin/rails +9 -0
  397. data/sample-apps/leaky-bucket-app/bin/rake +9 -0
  398. data/sample-apps/leaky-bucket-app/bin/setup +36 -0
  399. data/sample-apps/leaky-bucket-app/bin/spring +17 -0
  400. data/sample-apps/leaky-bucket-app/bin/update +31 -0
  401. data/sample-apps/leaky-bucket-app/bin/yarn +11 -0
  402. data/sample-apps/leaky-bucket-app/config.ru +5 -0
  403. data/sample-apps/leaky-bucket-app/config/application.rb +20 -0
  404. data/sample-apps/leaky-bucket-app/config/boot.rb +3 -0
  405. data/sample-apps/leaky-bucket-app/config/cable.yml +10 -0
  406. data/sample-apps/leaky-bucket-app/config/database.yml +25 -0
  407. data/sample-apps/leaky-bucket-app/config/environment.rb +5 -0
  408. data/sample-apps/leaky-bucket-app/config/environments/development.rb +65 -0
  409. data/sample-apps/leaky-bucket-app/config/environments/production.rb +94 -0
  410. data/sample-apps/leaky-bucket-app/config/environments/test.rb +46 -0
  411. data/sample-apps/leaky-bucket-app/config/initializers/assets.rb +14 -0
  412. data/sample-apps/leaky-bucket-app/config/initializers/filter_parameter_logging.rb +4 -0
  413. data/sample-apps/leaky-bucket-app/config/initializers/hubspot-api-ruby.rb +3 -0
  414. data/sample-apps/leaky-bucket-app/config/initializers/mime_types.rb +1 -0
  415. data/sample-apps/leaky-bucket-app/config/initializers/resque.rb +7 -0
  416. data/sample-apps/leaky-bucket-app/config/initializers/wrap_parameters.rb +14 -0
  417. data/sample-apps/leaky-bucket-app/config/locales/en.yml +33 -0
  418. data/sample-apps/leaky-bucket-app/config/puma.rb +34 -0
  419. data/sample-apps/leaky-bucket-app/config/routes.rb +10 -0
  420. data/sample-apps/leaky-bucket-app/config/spring.rb +6 -0
  421. data/sample-apps/leaky-bucket-app/db/seeds.rb +7 -0
  422. data/sample-apps/leaky-bucket-app/docker-compose.yml +25 -0
  423. data/sample-apps/leaky-bucket-app/docker-entrypoint.sh +8 -0
  424. data/sample-apps/leaky-bucket-app/lib/assets/.keep +0 -0
  425. data/sample-apps/leaky-bucket-app/lib/tasks/.keep +0 -0
  426. data/sample-apps/leaky-bucket-app/lib/tasks/leaky_bucket.rake +11 -0
  427. data/sample-apps/leaky-bucket-app/lib/tasks/resque.rake +11 -0
  428. data/sample-apps/leaky-bucket-app/log/.keep +0 -0
  429. data/sample-apps/leaky-bucket-app/package.json +5 -0
  430. data/sample-apps/leaky-bucket-app/public/404.html +67 -0
  431. data/sample-apps/leaky-bucket-app/public/422.html +67 -0
  432. data/sample-apps/leaky-bucket-app/public/500.html +66 -0
  433. data/sample-apps/leaky-bucket-app/public/apple-touch-icon-precomposed.png +0 -0
  434. data/sample-apps/leaky-bucket-app/public/apple-touch-icon.png +0 -0
  435. data/sample-apps/leaky-bucket-app/public/favicon.ico +0 -0
  436. data/sample-apps/leaky-bucket-app/public/robots.txt +1 -0
  437. data/sample-apps/leaky-bucket-app/resque-entrypoint.sh +9 -0
  438. data/sample-apps/leaky-bucket-app/tmp/.keep +0 -0
  439. data/sample-apps/oauth-app/app/controllers/contacts_controller.rb +3 -3
  440. data/sample-apps/oauth-app/app/lib/services/authorization/get_authorization_uri.rb +1 -1
  441. data/sample-apps/oauth-app/app/lib/services/authorization/tokens/generate.rb +1 -1
  442. data/sample-apps/oauth-app/app/lib/services/authorization/tokens/refresh.rb +1 -1
  443. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/create.rb +2 -2
  444. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/destroy.rb +2 -2
  445. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/export.rb +2 -15
  446. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/get_by_id.rb +2 -2
  447. data/sample-apps/{contacts-app/app/lib/services/hubspot/contacts/get_all.rb → oauth-app/app/lib/services/hubspot/contacts/get_page.rb} +3 -3
  448. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/search.rb +4 -4
  449. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/update.rb +2 -2
  450. data/sample-apps/oauth-app/app/lib/services/hubspot/owners/get_all.rb +1 -1
  451. data/sample-apps/oauth-app/app/views/oauth/authorization/login.html.erb +1 -1
  452. data/sample-apps/rate-limits-redis-sample-app/.env.template +3 -0
  453. data/sample-apps/rate-limits-redis-sample-app/.gitignore +34 -0
  454. data/sample-apps/rate-limits-redis-sample-app/.ruby-version +1 -0
  455. data/sample-apps/rate-limits-redis-sample-app/Dockerfile +22 -0
  456. data/sample-apps/rate-limits-redis-sample-app/Gemfile +39 -0
  457. data/sample-apps/rate-limits-redis-sample-app/Gemfile.lock +307 -0
  458. data/sample-apps/rate-limits-redis-sample-app/README.md +35 -0
  459. data/sample-apps/rate-limits-redis-sample-app/Rakefile +6 -0
  460. data/sample-apps/rate-limits-redis-sample-app/app/assets/config/manifest.js +3 -0
  461. data/sample-apps/rate-limits-redis-sample-app/app/assets/images/.keep +0 -0
  462. data/sample-apps/rate-limits-redis-sample-app/app/assets/javascripts/application.js +25 -0
  463. data/sample-apps/rate-limits-redis-sample-app/app/assets/javascripts/cable.js +13 -0
  464. data/sample-apps/rate-limits-redis-sample-app/app/assets/javascripts/channels/.keep +0 -0
  465. data/sample-apps/rate-limits-redis-sample-app/app/assets/stylesheets/application.css +90 -0
  466. data/sample-apps/rate-limits-redis-sample-app/app/controllers/application_controller.rb +12 -0
  467. data/sample-apps/rate-limits-redis-sample-app/app/controllers/concerns/.keep +0 -0
  468. data/sample-apps/rate-limits-redis-sample-app/app/controllers/concerns/exception_handler.rb +12 -0
  469. data/sample-apps/rate-limits-redis-sample-app/app/controllers/home_controller.rb +15 -0
  470. data/sample-apps/rate-limits-redis-sample-app/app/controllers/oauth/authorization_controller.rb +19 -0
  471. data/sample-apps/rate-limits-redis-sample-app/app/helpers/application_helper.rb +2 -0
  472. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/authorize_hubspot.rb +15 -0
  473. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/get_authorization_uri.rb +33 -0
  474. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/tokens/base.rb +19 -0
  475. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/tokens/generate.rb +26 -0
  476. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/tokens/refresh.rb +33 -0
  477. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb +29 -0
  478. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/create_batch.rb +37 -0
  479. data/sample-apps/rate-limits-redis-sample-app/app/models/application_record.rb +3 -0
  480. data/sample-apps/rate-limits-redis-sample-app/app/models/concerns/.keep +0 -0
  481. data/sample-apps/rate-limits-redis-sample-app/app/views/home/index.html.erb +13 -0
  482. data/sample-apps/rate-limits-redis-sample-app/app/views/layouts/application.html.erb +23 -0
  483. data/sample-apps/rate-limits-redis-sample-app/app/views/oauth/authorization/login.html.erb +15 -0
  484. data/sample-apps/rate-limits-redis-sample-app/app/views/shared/_header.html.erb +12 -0
  485. data/sample-apps/rate-limits-redis-sample-app/app/workers/redis_rate_limits_worker.rb +51 -0
  486. data/sample-apps/rate-limits-redis-sample-app/bin/bundle +3 -0
  487. data/sample-apps/rate-limits-redis-sample-app/bin/rails +9 -0
  488. data/sample-apps/rate-limits-redis-sample-app/bin/rake +9 -0
  489. data/sample-apps/rate-limits-redis-sample-app/bin/setup +36 -0
  490. data/sample-apps/rate-limits-redis-sample-app/bin/spring +17 -0
  491. data/sample-apps/rate-limits-redis-sample-app/bin/update +31 -0
  492. data/sample-apps/rate-limits-redis-sample-app/bin/yarn +11 -0
  493. data/sample-apps/rate-limits-redis-sample-app/config.ru +5 -0
  494. data/sample-apps/rate-limits-redis-sample-app/config/application.rb +20 -0
  495. data/sample-apps/rate-limits-redis-sample-app/config/boot.rb +3 -0
  496. data/sample-apps/rate-limits-redis-sample-app/config/cable.yml +10 -0
  497. data/sample-apps/rate-limits-redis-sample-app/config/database.yml +25 -0
  498. data/sample-apps/rate-limits-redis-sample-app/config/environment.rb +5 -0
  499. data/sample-apps/rate-limits-redis-sample-app/config/environments/development.rb +63 -0
  500. data/sample-apps/rate-limits-redis-sample-app/config/environments/production.rb +94 -0
  501. data/sample-apps/rate-limits-redis-sample-app/config/environments/test.rb +46 -0
  502. data/sample-apps/rate-limits-redis-sample-app/config/initializers/assets.rb +14 -0
  503. data/sample-apps/rate-limits-redis-sample-app/config/initializers/filter_parameter_logging.rb +4 -0
  504. data/sample-apps/rate-limits-redis-sample-app/config/initializers/hubspot-api-ruby.rb +3 -0
  505. data/sample-apps/rate-limits-redis-sample-app/config/initializers/mime_types.rb +1 -0
  506. data/sample-apps/rate-limits-redis-sample-app/config/initializers/resque.rb +7 -0
  507. data/sample-apps/rate-limits-redis-sample-app/config/initializers/wrap_parameters.rb +14 -0
  508. data/sample-apps/rate-limits-redis-sample-app/config/locales/en.yml +33 -0
  509. data/sample-apps/rate-limits-redis-sample-app/config/puma.rb +34 -0
  510. data/sample-apps/rate-limits-redis-sample-app/config/routes.rb +10 -0
  511. data/sample-apps/rate-limits-redis-sample-app/config/spring.rb +6 -0
  512. data/sample-apps/rate-limits-redis-sample-app/db/seeds.rb +7 -0
  513. data/sample-apps/rate-limits-redis-sample-app/docker-compose.yml +25 -0
  514. data/sample-apps/rate-limits-redis-sample-app/docker-entrypoint.sh +8 -0
  515. data/sample-apps/rate-limits-redis-sample-app/lib/assets/.keep +0 -0
  516. data/sample-apps/rate-limits-redis-sample-app/lib/tasks/.keep +0 -0
  517. data/sample-apps/rate-limits-redis-sample-app/lib/tasks/redis_rate_limits.rake +11 -0
  518. data/sample-apps/rate-limits-redis-sample-app/lib/tasks/resque.rake +11 -0
  519. data/sample-apps/rate-limits-redis-sample-app/log/.keep +0 -0
  520. data/sample-apps/rate-limits-redis-sample-app/package.json +5 -0
  521. data/sample-apps/rate-limits-redis-sample-app/public/404.html +67 -0
  522. data/sample-apps/rate-limits-redis-sample-app/public/422.html +67 -0
  523. data/sample-apps/rate-limits-redis-sample-app/public/500.html +66 -0
  524. data/sample-apps/rate-limits-redis-sample-app/public/apple-touch-icon-precomposed.png +0 -0
  525. data/sample-apps/rate-limits-redis-sample-app/public/apple-touch-icon.png +0 -0
  526. data/sample-apps/rate-limits-redis-sample-app/public/favicon.ico +0 -0
  527. data/sample-apps/rate-limits-redis-sample-app/public/robots.txt +1 -0
  528. data/sample-apps/rate-limits-redis-sample-app/resque-entrypoint.sh +9 -0
  529. data/sample-apps/rate-limits-redis-sample-app/tmp/.keep +0 -0
  530. data/sample-apps/retry-middleware-sample-app/Gemfile +1 -1
  531. data/sample-apps/retry-middleware-sample-app/Gemfile.lock +4 -3
  532. data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/get_authorization_uri.rb +1 -1
  533. data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/generate.rb +1 -1
  534. data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/refresh.rb +1 -1
  535. data/sample-apps/retry-middleware-sample-app/app/views/oauth/authorization/login.html.erb +1 -1
  536. data/sample-apps/retry-middleware-sample-app/lib/tasks/retry_middleware.rake +7 -7
  537. data/sample-apps/webhooks-contacts-app/Gemfile +1 -1
  538. data/sample-apps/webhooks-contacts-app/Gemfile.lock +4 -3
  539. data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/get_authorization_uri.rb +1 -1
  540. data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/tokens/generate.rb +1 -1
  541. data/sample-apps/webhooks-contacts-app/app/lib/services/authorization/tokens/refresh.rb +1 -1
  542. data/sample-apps/webhooks-contacts-app/app/lib/services/hubspot/contacts/get_batch.rb +3 -3
  543. data/sample-apps/webhooks-contacts-app/app/views/oauth/authorization/login.html.erb +1 -1
  544. data/spec/oauth/api/access_tokens_api_spec.rb +3 -3
  545. data/spec/oauth/api/refresh_tokens_api_spec.rb +3 -3
  546. data/spec/oauth/api/tokens_api_spec.rb +3 -3
  547. data/spec/oauth/api_client_spec.rb +23 -23
  548. data/spec/oauth/configuration_spec.rb +2 -2
  549. data/spec/oauth/models/access_token_info_response_spec.rb +3 -3
  550. data/spec/oauth/models/error_detail_spec.rb +3 -3
  551. data/spec/oauth/models/error_spec.rb +3 -3
  552. data/spec/oauth/models/json_node_spec.rb +3 -3
  553. data/spec/oauth/models/refresh_token_info_response_spec.rb +3 -3
  554. data/spec/oauth/models/refresh_token_spec.rb +3 -3
  555. data/spec/objects/api/associations_api_spec.rb +3 -3
  556. data/spec/objects/api/basic_api_spec.rb +3 -3
  557. data/spec/objects/api/batch_api_spec.rb +3 -3
  558. data/spec/objects/api/search_api_spec.rb +3 -3
  559. data/spec/objects/api_client_spec.rb +23 -23
  560. data/spec/objects/configuration_spec.rb +2 -2
  561. data/spec/objects/models/batch_input_simple_public_object_batch_input_spec.rb +3 -3
  562. data/spec/objects/models/batch_input_simple_public_object_id_spec.rb +3 -3
  563. data/spec/objects/models/batch_input_simple_public_object_input_spec.rb +3 -3
  564. data/spec/objects/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  565. data/spec/objects/models/batch_response_simple_public_object_spec.rb +3 -3
  566. data/spec/objects/models/collection_response_simple_public_object_id_spec.rb +3 -3
  567. data/spec/objects/models/collection_response_simple_public_object_spec.rb +3 -3
  568. data/spec/objects/models/collection_response_with_total_simple_public_object_spec.rb +3 -3
  569. data/spec/objects/models/error_detail_spec.rb +3 -3
  570. data/spec/objects/models/error_spec.rb +3 -3
  571. data/spec/objects/models/filter_group_spec.rb +3 -3
  572. data/spec/objects/models/filter_spec.rb +3 -3
  573. data/spec/objects/models/next_page_spec.rb +3 -3
  574. data/spec/objects/models/paging_spec.rb +3 -3
  575. data/spec/objects/models/public_object_search_request_spec.rb +3 -3
  576. data/spec/objects/models/simple_public_object_batch_input_spec.rb +3 -3
  577. data/spec/objects/models/simple_public_object_id_spec.rb +3 -3
  578. data/spec/objects/models/simple_public_object_input_spec.rb +3 -3
  579. data/spec/objects/models/simple_public_object_spec.rb +3 -3
  580. data/spec/owners/api/default_api_spec.rb +3 -3
  581. data/spec/owners/api_client_spec.rb +23 -23
  582. data/spec/owners/configuration_spec.rb +2 -2
  583. data/spec/owners/models/collection_response_public_owner_spec.rb +3 -3
  584. data/spec/owners/models/error_detail_spec.rb +3 -3
  585. data/spec/owners/models/error_spec.rb +3 -3
  586. data/spec/owners/models/next_page_spec.rb +3 -3
  587. data/spec/owners/models/paging_spec.rb +3 -3
  588. data/spec/owners/models/public_owner_spec.rb +3 -3
  589. data/spec/owners/models/public_team_spec.rb +3 -3
  590. data/spec/pipelines/api/pipeline_stages_api_spec.rb +3 -3
  591. data/spec/pipelines/api/pipelines_api_spec.rb +3 -3
  592. data/spec/pipelines/api_client_spec.rb +23 -23
  593. data/spec/pipelines/configuration_spec.rb +2 -2
  594. data/spec/pipelines/models/collection_response_pipeline_spec.rb +3 -3
  595. data/spec/pipelines/models/collection_response_pipeline_stage_spec.rb +3 -3
  596. data/spec/pipelines/models/error_detail_spec.rb +3 -3
  597. data/spec/pipelines/models/error_spec.rb +3 -3
  598. data/spec/pipelines/models/next_page_spec.rb +3 -3
  599. data/spec/pipelines/models/paging_spec.rb +3 -3
  600. data/spec/pipelines/models/pipeline_input_spec.rb +3 -3
  601. data/spec/pipelines/models/pipeline_patch_input_spec.rb +3 -3
  602. data/spec/pipelines/models/pipeline_spec.rb +3 -3
  603. data/spec/pipelines/models/pipeline_stage_input_spec.rb +3 -3
  604. data/spec/pipelines/models/pipeline_stage_patch_input_spec.rb +3 -3
  605. data/spec/pipelines/models/pipeline_stage_spec.rb +3 -3
  606. data/spec/properties/api/batch_api_spec.rb +3 -3
  607. data/spec/properties/api/core_api_spec.rb +3 -3
  608. data/spec/properties/api/groups_api_spec.rb +3 -3
  609. data/spec/properties/api_client_spec.rb +23 -23
  610. data/spec/properties/configuration_spec.rb +2 -2
  611. data/spec/properties/models/batch_input_property_create_spec.rb +3 -3
  612. data/spec/properties/models/batch_input_property_name_spec.rb +3 -3
  613. data/spec/properties/models/batch_read_input_property_name_spec.rb +3 -3
  614. data/spec/properties/models/batch_response_property_spec.rb +3 -3
  615. data/spec/properties/models/collection_response_property_group_spec.rb +3 -3
  616. data/spec/properties/models/collection_response_property_spec.rb +3 -3
  617. data/spec/properties/models/error_detail_spec.rb +3 -3
  618. data/spec/properties/models/error_spec.rb +3 -3
  619. data/spec/properties/models/next_page_spec.rb +3 -3
  620. data/spec/properties/models/option_input_spec.rb +3 -3
  621. data/spec/properties/models/option_spec.rb +3 -3
  622. data/spec/properties/models/paging_spec.rb +3 -3
  623. data/spec/properties/models/property_create_spec.rb +3 -3
  624. data/spec/properties/models/property_group_create_spec.rb +3 -3
  625. data/spec/properties/models/property_group_spec.rb +3 -3
  626. data/spec/properties/models/property_group_update_spec.rb +3 -3
  627. data/spec/properties/models/property_modification_metadata_spec.rb +3 -3
  628. data/spec/properties/models/property_name_spec.rb +3 -3
  629. data/spec/properties/models/property_spec.rb +3 -3
  630. data/spec/properties/models/property_update_spec.rb +3 -3
  631. metadata +544 -7
  632. data/lib/hubspot/codegen/crm/extensions/cards/api/default_api.rb +0 -318
@@ -6,83 +6,79 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
13
13
  require 'cgi'
14
14
 
15
15
  module Hubspot
16
- module Client
17
- module Crm
18
- module LineItems
19
- module Api
20
- class SearchApi
21
- attr_accessor :api_client
22
-
23
- def initialize(api_client = ApiClient.default)
24
- @api_client = api_client
25
- end
26
- # Filter, Sort, and Search CRM Objects
27
- # # Filter, Sort, and Search CRM Objects The CRM Search API is a powerful API that allows developers to filter, sort, and search across all line item types, including contacts, deals, companies and tickets. Using this API, developers can more efficiently retrieve a subset of data they are looking for to better suit their business needs. Common use cases this API allows for include, but are not limited to the following: <ul> <li>Getting a list of contacts for a specific account</li> <li>Retrieving a list of all open deals</li> <li>Searching for contacts by custom properties</li> <li>& more</li> </ul> Prerequisite for using this API: To use the CRM Search API with an OAuth token, your app must request and be granted access to the contacts scope. <br /> `engagements` including `tasks`, `calls`, `emails`, and `notes` are not supported. <br /> ## Filter Use `filterGroups` in the request body to limit results to specific CRM line items. *Example*: Find all contacts with a first name of \"Alice\" ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filterGroups\":[ { \"filters\":[ { \"propertyName\": \"firstname\", \"operator\": \"EQ\", \"value\": \"Alice\" } ] }] }' ``` When multiple `filters` are provided within a `filterGroup`, they will be combined using a logical `AND` operator. When multiple `filterGroup`s are provided, they will be combined using a logical `OR` operator. The system supports a maximum of three `filterGroups` with up to three `filters` per `filterGroup`. *Example*: Find all contacts with (a first name of \"Alice\" `AND` a last name that is not \"Smith\") OR has the property \"enum1\" ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filterGroups\":[ { \"filters\": [ { \"propertyName\": \"firstname\", \"operator\": \"EQ\", \"value\": \"Alice\" }, { \"propertyName\": \"lastname\", \"operator\": \"NEQ\", \"value\": \"Smith\" } ] }, { \"filters\": [ { \"property\": \"enum1\", \"operator\": \"HAS_PROPERTY\" } ] }] }' ``` <br /> ### Operators Supported operators include: |Operator|Description| |--|--| |`EQ`| equal to | |`NEQ`| not equal to | |`LT`| less than | |`LTE`| less than or equal to | |`GT`| greater than | |`GTE`| greater than or equal to | |`HAS_PROPERTY`| has the property | |`NOT_HAS_PROPERTY`| does not have the property | |`CONTAINS_TOKEN`| contains token, strings only | |`NOT_CONTAINS_TOKEN`| not contains token, strings only | <br /> ### Associations You can find line items associated with a different object type by ID using the `associations.line items` psuedo-property. Support for this is limited to `deals` and `tickets`. Supported association filters: |Object Type |Filter `propertyName` | |--|--| | `deals` | `associations.company`, `associations.contact`, `associations.ticket` | | `tickets` | `associations.company`, `associations.contact`, `associations.deal` | *Example*: Find all tickets associated with the contact using ID \"123\" ``` curl --request POST https://api.hubapi.com/crm/v3/line items/tickets/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"filters\": [ { \"propertyName\": \"associations.contact\", \"operator\": \"EQ\", \"value\": \"123\" } ] }' ``` <br /> ## Sort Use `sorts`, which contain a property name and a direction, to sort the returned collection. *Example*: List all contacts with most recently created first ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"sorts\": [ { \"propertyName\": \"createdate\", \"direction\": \"DESCENDING\" } ] }' ``` The system supports a single sort. <br /> ## Search Perform a text search against all property values for a line item type. By default, the results will be returned in order of object creation (oldest first) but this can be overridden using `sorts`. *Example*: Find all contacts with a property value containing the letter `x` ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"query\": \"x\" }' ``` <br /> ## Controlling returned properties Each object type is returned with a default set of properties. You can override this by providing an array of property names in the `properties` property of the request body. *Example*: Return all contacts and include their email and mailing address state ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"properties\": [ \"email\", \"state\" ] }' ``` <br /> ## Paging through results By default, the Search API returns results containing 10 line items per page. The system supports a maximum of 100 results per page. *Example*: Get pages of size 20 ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"limit\": 20 } ``` In order to access the next page of results, you must pass the `after` parameter that was provided in the previous response in the `paging.next.after` property. If no `paging.next.after` property is provided, no additional results will be shown. Note that the after parameter is expected to be a string. *Example*: Get the next page of results ``` curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey=demo \\ --header \"Content-Type: application/json\" \\ --data '{ \"after\": \"20\" }' ``` <br /> ## Sample Response (Success) ``` { \"results\": [ { \"id\": \"174\", \"properties\": { \"firstname\": \"Brantley\", \"lastname\": \"Forrest\", \"email\": \"bforrest8@acme.com\" }, \"createdAt\":\"2019-10-30T03:30:17.883Z\", \"updatedAt\": \"1569516907T16:50:06.678Z\", \"archived\": false }, ... ], \"paging\": { \"next\": { \"after\": \"10\" } } } ``` <br /> ## Limitations 1. It can take a few moments between creating or updating a line item in HubSpot and seeing it in CRM Search API results. 2. CRM line items in an archived state will not be available in the Search API. 3. The Search API is rate limited to 1 request per second per authentication token, which is more stringent than our general rate limits. The `X-HubSpot-RateLimit-*` headers will not reflect this during the beta period. Read more about [rate limits](https://developers.hubspot.com/docs/faq/working-within-the-hubspot-api-rate-limits). <br /> ## Error Handling Read our [error documentation](https://developers.hubspot.com/docs/faq/api-error-responses).
28
- # @param [Hash] opts the optional parameters
29
- # @option opts [PublicObjectSearchRequest] :public_object_search_request
30
- # @return [CollectionResponseWithTotalSimplePublicObject]
31
- def do_search(opts = {})
32
- data, _status_code, _headers = do_search_with_http_info(opts)
33
- data
34
- end
35
-
36
- # Filter, Sort, and Search CRM Objects
37
- # # Filter, Sort, and Search CRM Objects The CRM Search API is a powerful API that allows developers to filter, sort, and search across all line item types, including contacts, deals, companies and tickets. Using this API, developers can more efficiently retrieve a subset of data they are looking for to better suit their business needs. Common use cases this API allows for include, but are not limited to the following: &lt;ul&gt; &lt;li&gt;Getting a list of contacts for a specific account&lt;/li&gt; &lt;li&gt;Retrieving a list of all open deals&lt;/li&gt; &lt;li&gt;Searching for contacts by custom properties&lt;/li&gt; &lt;li&gt;&amp; more&lt;/li&gt; &lt;/ul&gt; Prerequisite for using this API: To use the CRM Search API with an OAuth token, your app must request and be granted access to the contacts scope. &lt;br /&gt; &#x60;engagements&#x60; including &#x60;tasks&#x60;, &#x60;calls&#x60;, &#x60;emails&#x60;, and &#x60;notes&#x60; are not supported. &lt;br /&gt; ## Filter Use &#x60;filterGroups&#x60; in the request body to limit results to specific CRM line items. *Example*: Find all contacts with a first name of \&quot;Alice\&quot; &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;filterGroups\&quot;:[ { \&quot;filters\&quot;:[ { \&quot;propertyName\&quot;: \&quot;firstname\&quot;, \&quot;operator\&quot;: \&quot;EQ\&quot;, \&quot;value\&quot;: \&quot;Alice\&quot; } ] }] }&#39; &#x60;&#x60;&#x60; When multiple &#x60;filters&#x60; are provided within a &#x60;filterGroup&#x60;, they will be combined using a logical &#x60;AND&#x60; operator. When multiple &#x60;filterGroup&#x60;s are provided, they will be combined using a logical &#x60;OR&#x60; operator. The system supports a maximum of three &#x60;filterGroups&#x60; with up to three &#x60;filters&#x60; per &#x60;filterGroup&#x60;. *Example*: Find all contacts with (a first name of \&quot;Alice\&quot; &#x60;AND&#x60; a last name that is not \&quot;Smith\&quot;) OR has the property \&quot;enum1\&quot; &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;filterGroups\&quot;:[ { \&quot;filters\&quot;: [ { \&quot;propertyName\&quot;: \&quot;firstname\&quot;, \&quot;operator\&quot;: \&quot;EQ\&quot;, \&quot;value\&quot;: \&quot;Alice\&quot; }, { \&quot;propertyName\&quot;: \&quot;lastname\&quot;, \&quot;operator\&quot;: \&quot;NEQ\&quot;, \&quot;value\&quot;: \&quot;Smith\&quot; } ] }, { \&quot;filters\&quot;: [ { \&quot;property\&quot;: \&quot;enum1\&quot;, \&quot;operator\&quot;: \&quot;HAS_PROPERTY\&quot; } ] }] }&#39; &#x60;&#x60;&#x60; &lt;br /&gt; ### Operators Supported operators include: |Operator|Description| |--|--| |&#x60;EQ&#x60;| equal to | |&#x60;NEQ&#x60;| not equal to | |&#x60;LT&#x60;| less than | |&#x60;LTE&#x60;| less than or equal to | |&#x60;GT&#x60;| greater than | |&#x60;GTE&#x60;| greater than or equal to | |&#x60;HAS_PROPERTY&#x60;| has the property | |&#x60;NOT_HAS_PROPERTY&#x60;| does not have the property | |&#x60;CONTAINS_TOKEN&#x60;| contains token, strings only | |&#x60;NOT_CONTAINS_TOKEN&#x60;| not contains token, strings only | &lt;br /&gt; ### Associations You can find line items associated with a different object type by ID using the &#x60;associations.line items&#x60; psuedo-property. Support for this is limited to &#x60;deals&#x60; and &#x60;tickets&#x60;. Supported association filters: |Object Type |Filter &#x60;propertyName&#x60; | |--|--| | &#x60;deals&#x60; | &#x60;associations.company&#x60;, &#x60;associations.contact&#x60;, &#x60;associations.ticket&#x60; | | &#x60;tickets&#x60; | &#x60;associations.company&#x60;, &#x60;associations.contact&#x60;, &#x60;associations.deal&#x60; | *Example*: Find all tickets associated with the contact using ID \&quot;123\&quot; &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/tickets/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;filters\&quot;: [ { \&quot;propertyName\&quot;: \&quot;associations.contact\&quot;, \&quot;operator\&quot;: \&quot;EQ\&quot;, \&quot;value\&quot;: \&quot;123\&quot; } ] }&#39; &#x60;&#x60;&#x60; &lt;br /&gt; ## Sort Use &#x60;sorts&#x60;, which contain a property name and a direction, to sort the returned collection. *Example*: List all contacts with most recently created first &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;sorts\&quot;: [ { \&quot;propertyName\&quot;: \&quot;createdate\&quot;, \&quot;direction\&quot;: \&quot;DESCENDING\&quot; } ] }&#39; &#x60;&#x60;&#x60; The system supports a single sort. &lt;br /&gt; ## Search Perform a text search against all property values for a line item type. By default, the results will be returned in order of object creation (oldest first) but this can be overridden using &#x60;sorts&#x60;. *Example*: Find all contacts with a property value containing the letter &#x60;x&#x60; &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;query\&quot;: \&quot;x\&quot; }&#39; &#x60;&#x60;&#x60; &lt;br /&gt; ## Controlling returned properties Each object type is returned with a default set of properties. You can override this by providing an array of property names in the &#x60;properties&#x60; property of the request body. *Example*: Return all contacts and include their email and mailing address state &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;properties\&quot;: [ \&quot;email\&quot;, \&quot;state\&quot; ] }&#39; &#x60;&#x60;&#x60; &lt;br /&gt; ## Paging through results By default, the Search API returns results containing 10 line items per page. The system supports a maximum of 100 results per page. *Example*: Get pages of size 20 &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;limit\&quot;: 20 } &#x60;&#x60;&#x60; In order to access the next page of results, you must pass the &#x60;after&#x60; parameter that was provided in the previous response in the &#x60;paging.next.after&#x60; property. If no &#x60;paging.next.after&#x60; property is provided, no additional results will be shown. Note that the after parameter is expected to be a string. *Example*: Get the next page of results &#x60;&#x60;&#x60; curl --request POST https://api.hubapi.com/crm/v3/line items/contacts/search?hapikey&#x3D;demo \\ --header \&quot;Content-Type: application/json\&quot; \\ --data &#39;{ \&quot;after\&quot;: \&quot;20\&quot; }&#39; &#x60;&#x60;&#x60; &lt;br /&gt; ## Sample Response (Success) &#x60;&#x60;&#x60; { \&quot;results\&quot;: [ { \&quot;id\&quot;: \&quot;174\&quot;, \&quot;properties\&quot;: { \&quot;firstname\&quot;: \&quot;Brantley\&quot;, \&quot;lastname\&quot;: \&quot;Forrest\&quot;, \&quot;email\&quot;: \&quot;bforrest8@acme.com\&quot; }, \&quot;createdAt\&quot;:\&quot;2019-10-30T03:30:17.883Z\&quot;, \&quot;updatedAt\&quot;: \&quot;1569516907T16:50:06.678Z\&quot;, \&quot;archived\&quot;: false }, ... ], \&quot;paging\&quot;: { \&quot;next\&quot;: { \&quot;after\&quot;: \&quot;10\&quot; } } } &#x60;&#x60;&#x60; &lt;br /&gt; ## Limitations 1. It can take a few moments between creating or updating a line item in HubSpot and seeing it in CRM Search API results. 2. CRM line items in an archived state will not be available in the Search API. 3. The Search API is rate limited to 1 request per second per authentication token, which is more stringent than our general rate limits. The &#x60;X-HubSpot-RateLimit-*&#x60; headers will not reflect this during the beta period. Read more about [rate limits](https://developers.hubspot.com/docs/faq/working-within-the-hubspot-api-rate-limits). &lt;br /&gt; ## Error Handling Read our [error documentation](https://developers.hubspot.com/docs/faq/api-error-responses).
38
- # @param [Hash] opts the optional parameters
39
- # @option opts [PublicObjectSearchRequest] :public_object_search_request
40
- # @return [Array<(CollectionResponseWithTotalSimplePublicObject, Integer, Hash)>] CollectionResponseWithTotalSimplePublicObject data, response status code and response headers
41
- def do_search_with_http_info(opts = {})
42
- if @api_client.config.debugging
43
- @api_client.config.logger.debug 'Calling API: SearchApi.do_search ...'
44
- end
45
- # resource path
46
- local_var_path = '/line items/search'
47
-
48
- # query parameters
49
- query_params = opts[:query_params] || {}
50
-
51
- # header parameters
52
- header_params = opts[:header_params] || {}
53
- # HTTP header 'Accept' (if needed)
54
- header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
55
- # HTTP header 'Content-Type'
56
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
-
58
- # form parameters
59
- form_params = opts[:form_params] || {}
60
-
61
- # http body (model)
62
- post_body = opts[:body] || @api_client.object_to_http_body(opts[:'public_object_search_request'])
63
-
64
- # return_type
65
- return_type = opts[:return_type] || 'CollectionResponseWithTotalSimplePublicObject'
66
-
67
- # auth_names
68
- auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
69
-
70
- new_options = opts.merge(
71
- :header_params => header_params,
72
- :query_params => query_params,
73
- :form_params => form_params,
74
- :body => post_body,
75
- :auth_names => auth_names,
76
- :return_type => return_type
77
- )
78
-
79
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
- if @api_client.config.debugging
81
- @api_client.config.logger.debug "API called: SearchApi#do_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
- end
83
- return data, status_code, headers
84
- end
16
+ module Crm
17
+ module LineItems
18
+ class SearchApi
19
+ attr_accessor :api_client
20
+
21
+ def initialize(api_client = ApiClient.default)
22
+ @api_client = api_client
23
+ end
24
+ # Filter, Sort, and Search CRM Objects
25
+ # Filter, Sort, and Search CRM Objects
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [PublicObjectSearchRequest] :public_object_search_request
28
+ # @return [CollectionResponseWithTotalSimplePublicObject]
29
+ def do_search(opts = {})
30
+ data, _status_code, _headers = do_search_with_http_info(opts)
31
+ data
32
+ end
33
+
34
+ # Filter, Sort, and Search CRM Objects
35
+ # Filter, Sort, and Search CRM Objects
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [PublicObjectSearchRequest] :public_object_search_request
38
+ # @return [Array<(CollectionResponseWithTotalSimplePublicObject, Integer, Hash)>] CollectionResponseWithTotalSimplePublicObject data, response status code and response headers
39
+ def do_search_with_http_info(opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: SearchApi.do_search ...'
42
+ end
43
+ # resource path
44
+ local_var_path = '/crm/v3/objects/line_items/search'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
53
+ # HTTP header 'Content-Type'
54
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'public_object_search_request'])
61
+
62
+ # return_type
63
+ return_type = opts[:return_type] || 'CollectionResponseWithTotalSimplePublicObject'
64
+
65
+ # auth_names
66
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
67
+
68
+ new_options = opts.merge(
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type
75
+ )
76
+
77
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "API called: SearchApi#do_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
80
  end
81
+ return data, status_code, headers
86
82
  end
87
83
  end
88
84
  end
@@ -17,404 +17,402 @@ require 'tempfile'
17
17
  require 'faraday'
18
18
 
19
19
  module Hubspot
20
- module Client
21
- module Crm
22
- module LineItems
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 = "OpenAPI-Generator/#{VERSION}/ruby"
37
- @default_headers = {
38
- 'Content-Type' => 'application/json',
39
- 'User-Agent' => @user_agent
40
- }
41
- end
20
+ module Crm
21
+ module LineItems
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
42
41
 
43
- def self.default
44
- @@default ||= ApiClient.new
45
- end
42
+ def self.default
43
+ @@default ||= ApiClient.new
44
+ end
46
45
 
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
- ssl_options = {
53
- :ca_file => @config.ssl_ca_file,
54
- :verify => @config.ssl_verify,
55
- :verify_mode => @config.ssl_verify_mode,
56
- :client_cert => @config.ssl_client_cert,
57
- :client_key => @config.ssl_client_key
58
- }
59
-
60
- connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
61
- conn.basic_auth(config.username, config.password)
62
- if opts[:header_params]["Content-Type"] == "multipart/form-data"
63
- conn.request :multipart
64
- conn.request :url_encoded
65
- end
66
- conn.adapter(Faraday.default_adapter)
67
-
68
- # Errors handler settings
69
- if !config.error_handler.empty?
70
- config.error_handler.each do |statuses, opts|
71
- statuses = statuses.is_a?(Integer) ? [statuses] : statuses
72
- retry_options = {
73
- max: opts[:max_retries],
74
- interval: opts[:seconds_delay],
75
- retry_statuses: statuses,
76
- methods: %i[post delete get head options put],
77
- retry_block: -> (env, options, retries, exc) { opts[:retry_block].call }
78
- }
79
- conn.request :retry, retry_options
80
- end
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
+ ssl_options = {
52
+ :ca_file => @config.ssl_ca_file,
53
+ :verify => @config.ssl_verify,
54
+ :verify_mode => @config.ssl_verify_mode,
55
+ :client_cert => @config.ssl_client_cert,
56
+ :client_key => @config.ssl_client_key
57
+ }
58
+
59
+ connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn|
60
+ conn.basic_auth(config.username, config.password)
61
+ if opts[:header_params]["Content-Type"] == "multipart/form-data"
62
+ conn.request :multipart
63
+ conn.request :url_encoded
64
+ end
65
+ conn.adapter(Faraday.default_adapter)
66
+
67
+ # Errors handler settings
68
+ if !config.error_handler.empty?
69
+ config.error_handler.each do |statuses, opts|
70
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
71
+ retry_options = {
72
+ max: opts[:max_retries],
73
+ interval: opts[:seconds_delay],
74
+ retry_statuses: statuses,
75
+ methods: %i[post delete get head options put],
76
+ retry_block: -> (env, options, retries, exc) { opts[:retry_block].call }
77
+ }
78
+ conn.request :retry, retry_options
81
79
  end
82
80
  end
81
+ end
83
82
 
84
- begin
85
- response = connection.public_send(http_method.to_sym.downcase) do |req|
86
- build_request(http_method, path, req, opts)
87
- end
83
+ begin
84
+ response = connection.public_send(http_method.to_sym.downcase) do |req|
85
+ build_request(http_method, path, req, opts)
86
+ end
88
87
 
89
- if @config.debugging
90
- @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
91
- end
88
+ if @config.debugging
89
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
90
+ end
92
91
 
93
- unless response.success?
94
- if response.status == 0
95
- # Errors from libcurl will be made visible here
96
- fail ApiError.new(:code => 0,
97
- :message => response.return_message)
98
- else
99
- fail ApiError.new(:code => response.status,
100
- :response_headers => response.headers,
101
- :response_body => response.body),
102
- response.reason_phrase
103
- end
92
+ unless response.success?
93
+ if response.status == 0
94
+ # Errors from libcurl will be made visible here
95
+ fail ApiError.new(:code => 0,
96
+ :message => response.return_message)
97
+ else
98
+ fail ApiError.new(:code => response.status,
99
+ :response_headers => response.headers,
100
+ :response_body => response.body),
101
+ response.reason_phrase
104
102
  end
105
- rescue Faraday::TimeoutError
106
- fail ApiError.new('Connection timed out')
107
103
  end
104
+ rescue Faraday::TimeoutError
105
+ fail ApiError.new('Connection timed out')
106
+ end
108
107
 
109
- if opts[:return_type]
110
- data = deserialize(response, opts[:return_type])
111
- else
112
- data = nil
113
- end
114
- return data, response.status, response.headers
108
+ if opts[:return_type]
109
+ data = deserialize(response, opts[:return_type])
110
+ else
111
+ data = nil
115
112
  end
113
+ return data, response.status, response.headers
114
+ end
116
115
 
117
- # Builds the HTTP request
118
- #
119
- # @param [String] http_method HTTP method/verb (e.g. POST)
120
- # @param [String] path URL path (e.g. /account/new)
121
- # @option opts [Hash] :header_params Header parameters
122
- # @option opts [Hash] :query_params Query parameters
123
- # @option opts [Hash] :form_params Query parameters
124
- # @option opts [Object] :body HTTP body (JSON/XML)
125
- # @return [Typhoeus::Request] A Typhoeus Request
126
- def build_request(http_method, path, request, opts = {})
127
- url = build_request_url(path)
128
- http_method = http_method.to_sym.downcase
129
-
130
- header_params = @default_headers.merge(opts[:header_params] || {})
131
- query_params = opts[:query_params] || {}
132
- form_params = opts[:form_params] || {}
133
-
134
- update_params_for_auth! header_params, query_params, opts[:auth_names]
135
-
136
- req_opts = {
137
- :method => http_method,
138
- :headers => header_params,
139
- :params => query_params,
140
- :params_encoding => @config.params_encoding,
141
- :timeout => @config.timeout,
142
- :verbose => @config.debugging
143
- }
144
-
145
- if [:post, :patch, :put, :delete].include?(http_method)
146
- req_body = build_request_body(header_params, form_params, opts[:body])
147
- req_opts.update :body => req_body
148
- if @config.debugging
149
- @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
150
- end
116
+ # Builds the HTTP request
117
+ #
118
+ # @param [String] http_method HTTP method/verb (e.g. POST)
119
+ # @param [String] path URL path (e.g. /account/new)
120
+ # @option opts [Hash] :header_params Header parameters
121
+ # @option opts [Hash] :query_params Query parameters
122
+ # @option opts [Hash] :form_params Query parameters
123
+ # @option opts [Object] :body HTTP body (JSON/XML)
124
+ # @return [Typhoeus::Request] A Typhoeus Request
125
+ def build_request(http_method, path, request, opts = {})
126
+ url = build_request_url(path)
127
+ http_method = http_method.to_sym.downcase
128
+
129
+ header_params = @default_headers.merge(opts[:header_params] || {})
130
+ query_params = opts[:query_params] || {}
131
+ form_params = opts[:form_params] || {}
132
+
133
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
134
+
135
+ req_opts = {
136
+ :method => http_method,
137
+ :headers => header_params,
138
+ :params => query_params,
139
+ :params_encoding => @config.params_encoding,
140
+ :timeout => @config.timeout,
141
+ :verbose => @config.debugging
142
+ }
143
+
144
+ if [:post, :patch, :put, :delete].include?(http_method)
145
+ req_body = build_request_body(header_params, form_params, opts[:body])
146
+ req_opts.update :body => req_body
147
+ if @config.debugging
148
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
151
149
  end
152
- request.headers = header_params
153
- request.body = req_body
154
- request.url url
155
- request.params = query_params
156
- download_file(request) if opts[:return_type] == 'File'
157
- request
158
150
  end
151
+ request.headers = header_params
152
+ request.body = req_body
153
+ request.url url
154
+ request.params = query_params
155
+ download_file(request) if opts[:return_type] == 'File'
156
+ request
157
+ end
159
158
 
160
- # Builds the HTTP request body
161
- #
162
- # @param [Hash] header_params Header parameters
163
- # @param [Hash] form_params Query parameters
164
- # @param [Object] body HTTP body (JSON/XML)
165
- # @return [String] HTTP body data in the form of string
166
- def build_request_body(header_params, form_params, body)
167
- # http form
168
- if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
169
- data = URI.encode_www_form(form_params)
170
- elsif header_params['Content-Type'] == 'multipart/form-data'
171
- data = {}
172
- form_params.each do |key, value|
173
- case value
174
- when ::File, ::Tempfile
175
- # TODO hardcode to application/octet-stream, need better way to detect content type
176
- data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
177
- when ::Array, nil
178
- # let Faraday handle Array and nil parameters
179
- data[key] = value
180
- else
181
- data[key] = value.to_s
182
- end
159
+ # Builds the HTTP request body
160
+ #
161
+ # @param [Hash] header_params Header parameters
162
+ # @param [Hash] form_params Query parameters
163
+ # @param [Object] body HTTP body (JSON/XML)
164
+ # @return [String] HTTP body data in the form of string
165
+ def build_request_body(header_params, form_params, body)
166
+ # http form
167
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded'
168
+ data = URI.encode_www_form(form_params)
169
+ elsif header_params['Content-Type'] == 'multipart/form-data'
170
+ data = {}
171
+ form_params.each do |key, value|
172
+ case value
173
+ when ::File, ::Tempfile
174
+ # TODO hardcode to application/octet-stream, need better way to detect content type
175
+ data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path)
176
+ when ::Array, nil
177
+ # let Faraday handle Array and nil parameters
178
+ data[key] = value
179
+ else
180
+ data[key] = value.to_s
183
181
  end
184
- elsif body
185
- data = body.is_a?(String) ? body : body.to_json
186
- else
187
- data = nil
188
182
  end
189
- data
183
+ elsif body
184
+ data = body.is_a?(String) ? body : body.to_json
185
+ else
186
+ data = nil
190
187
  end
188
+ data
189
+ end
191
190
 
192
- # Check if the given MIME is a JSON MIME.
193
- # JSON MIME examples:
194
- # application/json
195
- # application/json; charset=UTF8
196
- # APPLICATION/JSON
197
- # */*
198
- # @param [String] mime MIME
199
- # @return [Boolean] True if the MIME is application/json
200
- def json_mime?(mime)
201
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
202
- end
191
+ # Check if the given MIME is a JSON MIME.
192
+ # JSON MIME examples:
193
+ # application/json
194
+ # application/json; charset=UTF8
195
+ # APPLICATION/JSON
196
+ # */*
197
+ # @param [String] mime MIME
198
+ # @return [Boolean] True if the MIME is application/json
199
+ def json_mime?(mime)
200
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
201
+ end
203
202
 
204
- # Deserialize the response to the given return type.
205
- #
206
- # @param [Response] response HTTP response
207
- # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
208
- def deserialize(response, return_type)
209
- body = response.body
203
+ # Deserialize the response to the given return type.
204
+ #
205
+ # @param [Response] response HTTP response
206
+ # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
207
+ def deserialize(response, return_type)
208
+ body = response.body
210
209
 
211
- # handle file downloading - return the File instance processed in request callbacks
212
- # note that response body is empty when the file is written in chunks in request on_body callback
213
- return @tempfile if return_type == 'File'
210
+ # handle file downloading - return the File instance processed in request callbacks
211
+ # note that response body is empty when the file is written in chunks in request on_body callback
212
+ return @tempfile if return_type == 'File'
214
213
 
215
- return nil if body.nil? || body.empty?
214
+ return nil if body.nil? || body.empty?
216
215
 
217
- # return response body directly for String return type
218
- return body if return_type == 'String'
216
+ # return response body directly for String return type
217
+ return body if return_type == 'String'
219
218
 
220
- # ensuring a default content type
221
- content_type = response.headers['Content-Type'] || 'application/json'
219
+ # ensuring a default content type
220
+ content_type = response.headers['Content-Type'] || 'application/json'
222
221
 
223
- fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
222
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
224
223
 
225
- begin
226
- data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
227
- rescue JSON::ParserError => e
228
- if %w(String Date DateTime).include?(return_type)
229
- data = body
230
- else
231
- raise e
232
- end
224
+ begin
225
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
226
+ rescue JSON::ParserError => e
227
+ if %w(String Date DateTime).include?(return_type)
228
+ data = body
229
+ else
230
+ raise e
233
231
  end
234
-
235
- convert_to_type data, return_type
236
232
  end
237
233
 
238
- # Convert data to the given return type.
239
- # @param [Object] data Data to be converted
240
- # @param [String] return_type Return type
241
- # @return [Mixed] Data in a particular type
242
- def convert_to_type(data, return_type)
243
- return nil if data.nil?
244
- case return_type
245
- when 'String'
246
- data.to_s
247
- when 'Integer'
248
- data.to_i
249
- when 'Float'
250
- data.to_f
251
- when 'Boolean'
252
- data == true
253
- when 'DateTime'
254
- # parse date time (expecting ISO 8601 format)
255
- DateTime.parse data
256
- when 'Date'
257
- # parse date time (expecting ISO 8601 format)
258
- Date.parse data
259
- when 'Object'
260
- # generic object (usually a Hash), return directly
261
- data
262
- when /\AArray<(.+)>\z/
263
- # e.g. Array<Pet>
264
- sub_type = $1
265
- data.map { |item| convert_to_type(item, sub_type) }
266
- when /\AHash\<String, (.+)\>\z/
267
- # e.g. Hash<String, Integer>
268
- sub_type = $1
269
- {}.tap do |hash|
270
- data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
271
- end
272
- else
273
- # models, e.g. Pet
274
- Hubspot::Client::Crm::LineItems::Models.const_get(return_type).build_from_hash(data)
234
+ convert_to_type data, return_type
235
+ end
236
+
237
+ # Convert data to the given return type.
238
+ # @param [Object] data Data to be converted
239
+ # @param [String] return_type Return type
240
+ # @return [Mixed] Data in a particular type
241
+ def convert_to_type(data, return_type)
242
+ return nil if data.nil?
243
+ case return_type
244
+ when 'String'
245
+ data.to_s
246
+ when 'Integer'
247
+ data.to_i
248
+ when 'Float'
249
+ data.to_f
250
+ when 'Boolean'
251
+ data == true
252
+ when 'DateTime'
253
+ # parse date time (expecting ISO 8601 format)
254
+ DateTime.parse data
255
+ when 'Date'
256
+ # parse date time (expecting ISO 8601 format)
257
+ Date.parse data
258
+ when 'Object'
259
+ # generic object (usually a Hash), return directly
260
+ data
261
+ when /\AArray<(.+)>\z/
262
+ # e.g. Array<Pet>
263
+ sub_type = $1
264
+ data.map { |item| convert_to_type(item, sub_type) }
265
+ when /\AHash\<String, (.+)\>\z/
266
+ # e.g. Hash<String, Integer>
267
+ sub_type = $1
268
+ {}.tap do |hash|
269
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
275
270
  end
271
+ else
272
+ # models, e.g. Pet
273
+ Hubspot::Crm::LineItems.const_get(return_type).build_from_hash(data)
276
274
  end
275
+ end
277
276
 
278
- # Save response body into a file in (the defined) temporary folder, using the filename
279
- # from the "Content-Disposition" header if provided, otherwise a random filename.
280
- # The response body is written to the file in chunks in order to handle files which
281
- # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
282
- # process can use.
283
- #
284
- # @see Configuration#temp_folder_path
285
- def download_file(request)
286
- tempfile = nil
287
- encoding = nil
288
- request.on_headers do |response|
289
- content_disposition = response.headers['Content-Disposition']
290
- if content_disposition && content_disposition =~ /filename=/i
291
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
292
- prefix = sanitize_filename(filename)
293
- else
294
- prefix = 'download-'
295
- end
296
- prefix = prefix + '-' unless prefix.end_with?('-')
297
- encoding = response.body.encoding
298
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
299
- @tempfile = tempfile
300
- end
301
- request.on_body do |chunk|
302
- chunk.force_encoding(encoding)
303
- tempfile.write(chunk)
304
- end
305
- request.on_complete do |response|
306
- tempfile.close if tempfile
307
- @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
308
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
309
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
310
- "explicitly with `tempfile.delete`"
277
+ # Save response body into a file in (the defined) temporary folder, using the filename
278
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
279
+ # The response body is written to the file in chunks in order to handle files which
280
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
281
+ # process can use.
282
+ #
283
+ # @see Configuration#temp_folder_path
284
+ def download_file(request)
285
+ tempfile = nil
286
+ encoding = nil
287
+ request.on_headers do |response|
288
+ content_disposition = response.headers['Content-Disposition']
289
+ if content_disposition && content_disposition =~ /filename=/i
290
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
291
+ prefix = sanitize_filename(filename)
292
+ else
293
+ prefix = 'download-'
311
294
  end
295
+ prefix = prefix + '-' unless prefix.end_with?('-')
296
+ encoding = response.body.encoding
297
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
298
+ @tempfile = tempfile
312
299
  end
313
-
314
- # Sanitize filename by removing path.
315
- # e.g. ../../sun.gif becomes sun.gif
316
- #
317
- # @param [String] filename the filename to be sanitized
318
- # @return [String] the sanitized filename
319
- def sanitize_filename(filename)
320
- filename.gsub(/.*[\/\\]/, '')
300
+ request.on_body do |chunk|
301
+ chunk.force_encoding(encoding)
302
+ tempfile.write(chunk)
321
303
  end
322
-
323
- def build_request_url(path)
324
- # Add leading and trailing slashes to path
325
- path = "/#{path}".gsub(/\/+/, '/')
326
- @config.base_url + path
304
+ request.on_complete do |response|
305
+ tempfile.close if tempfile
306
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
307
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
308
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
309
+ "explicitly with `tempfile.delete`"
327
310
  end
311
+ end
328
312
 
329
- # Update hearder and query params based on authentication settings.
330
- #
331
- # @param [Hash] header_params Header parameters
332
- # @param [Hash] query_params Query parameters
333
- # @param [String] auth_names Authentication scheme name
334
- def update_params_for_auth!(header_params, query_params, auth_names)
335
- Array(auth_names).each do |auth_name|
336
- auth_setting = @config.auth_settings[auth_name]
337
- next unless auth_setting
338
- case auth_setting[:in]
339
- when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
340
- when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
341
- else fail ArgumentError, 'Authentication token must be in `query` of `header`'
342
- end
313
+ # Sanitize filename by removing path.
314
+ # e.g. ../../sun.gif becomes sun.gif
315
+ #
316
+ # @param [String] filename the filename to be sanitized
317
+ # @return [String] the sanitized filename
318
+ def sanitize_filename(filename)
319
+ filename.gsub(/.*[\/\\]/, '')
320
+ end
321
+
322
+ def build_request_url(path)
323
+ # Add leading and trailing slashes to path
324
+ path = "/#{path}".gsub(/\/+/, '/')
325
+ @config.base_url + path
326
+ end
327
+
328
+ # Update hearder and query params based on authentication settings.
329
+ #
330
+ # @param [Hash] header_params Header parameters
331
+ # @param [Hash] query_params Query parameters
332
+ # @param [String] auth_names Authentication scheme name
333
+ def update_params_for_auth!(header_params, query_params, auth_names)
334
+ Array(auth_names).each do |auth_name|
335
+ auth_setting = @config.auth_settings[auth_name]
336
+ next unless auth_setting
337
+ case auth_setting[:in]
338
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
339
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
340
+ else fail ArgumentError, 'Authentication token must be in `query` of `header`'
343
341
  end
344
342
  end
343
+ end
345
344
 
346
- # Sets user agent in HTTP header
347
- #
348
- # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
349
- def user_agent=(user_agent)
350
- @user_agent = user_agent
351
- @default_headers['User-Agent'] = @user_agent
352
- end
345
+ # Sets user agent in HTTP header
346
+ #
347
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
348
+ def user_agent=(user_agent)
349
+ @user_agent = user_agent
350
+ @default_headers['User-Agent'] = @user_agent
351
+ end
353
352
 
354
- # Return Accept header based on an array of accepts provided.
355
- # @param [Array] accepts array for Accept
356
- # @return [String] the Accept header (e.g. application/json)
357
- def select_header_accept(accepts)
358
- return nil if accepts.nil? || accepts.empty?
359
- # use JSON when present, otherwise use all of the provided
360
- json_accept = accepts.find { |s| json_mime?(s) }
361
- json_accept || accepts.join(',')
362
- end
353
+ # Return Accept header based on an array of accepts provided.
354
+ # @param [Array] accepts array for Accept
355
+ # @return [String] the Accept header (e.g. application/json)
356
+ def select_header_accept(accepts)
357
+ return nil if accepts.nil? || accepts.empty?
358
+ # use JSON when present, otherwise use all of the provided
359
+ json_accept = accepts.find { |s| json_mime?(s) }
360
+ json_accept || accepts.join(',')
361
+ end
363
362
 
364
- # Return Content-Type header based on an array of content types provided.
365
- # @param [Array] content_types array for Content-Type
366
- # @return [String] the Content-Type header (e.g. application/json)
367
- def select_header_content_type(content_types)
368
- # use application/json by default
369
- return 'application/json' if content_types.nil? || content_types.empty?
370
- # use JSON when present, otherwise use the first one
371
- json_content_type = content_types.find { |s| json_mime?(s) }
372
- json_content_type || content_types.first
373
- end
363
+ # Return Content-Type header based on an array of content types provided.
364
+ # @param [Array] content_types array for Content-Type
365
+ # @return [String] the Content-Type header (e.g. application/json)
366
+ def select_header_content_type(content_types)
367
+ # use application/json by default
368
+ return 'application/json' if content_types.nil? || content_types.empty?
369
+ # use JSON when present, otherwise use the first one
370
+ json_content_type = content_types.find { |s| json_mime?(s) }
371
+ json_content_type || content_types.first
372
+ end
374
373
 
375
- # Convert object (array, hash, object, etc) to JSON string.
376
- # @param [Object] model object to be converted into JSON string
377
- # @return [String] JSON string representation of the object
378
- def object_to_http_body(model)
379
- return model if model.nil? || model.is_a?(String)
380
- local_body = nil
381
- if model.is_a?(Array)
382
- local_body = model.map { |m| object_to_hash(m) }
383
- else
384
- local_body = object_to_hash(model)
385
- end
386
- local_body.to_json
374
+ # Convert object (array, hash, object, etc) to JSON string.
375
+ # @param [Object] model object to be converted into JSON string
376
+ # @return [String] JSON string representation of the object
377
+ def object_to_http_body(model)
378
+ return model if model.nil? || model.is_a?(String)
379
+ local_body = nil
380
+ if model.is_a?(Array)
381
+ local_body = model.map { |m| object_to_hash(m) }
382
+ else
383
+ local_body = object_to_hash(model)
387
384
  end
385
+ local_body.to_json
386
+ end
388
387
 
389
- # Convert object(non-array) to hash.
390
- # @param [Object] obj object to be converted into JSON string
391
- # @return [String] JSON string representation of the object
392
- def object_to_hash(obj)
393
- if obj.respond_to?(:to_hash)
394
- obj.to_hash
395
- else
396
- obj
397
- end
388
+ # Convert object(non-array) to hash.
389
+ # @param [Object] obj object to be converted into JSON string
390
+ # @return [String] JSON string representation of the object
391
+ def object_to_hash(obj)
392
+ if obj.respond_to?(:to_hash)
393
+ obj.to_hash
394
+ else
395
+ obj
398
396
  end
397
+ end
399
398
 
400
- # Build parameter value according to the given collection format.
401
- # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
402
- def build_collection_param(param, collection_format)
403
- case collection_format
404
- when :csv
405
- param.join(',')
406
- when :ssv
407
- param.join(' ')
408
- when :tsv
409
- param.join("\t")
410
- when :pipes
411
- param.join('|')
412
- when :multi
413
- # return the array directly as typhoeus will handle it as expected
414
- param
415
- else
416
- fail "unknown collection format: #{collection_format.inspect}"
417
- end
399
+ # Build parameter value according to the given collection format.
400
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
401
+ def build_collection_param(param, collection_format)
402
+ case collection_format
403
+ when :csv
404
+ param.join(',')
405
+ when :ssv
406
+ param.join(' ')
407
+ when :tsv
408
+ param.join("\t")
409
+ when :pipes
410
+ param.join('|')
411
+ when :multi
412
+ # return the array directly as typhoeus will handle it as expected
413
+ param
414
+ else
415
+ fail "unknown collection format: #{collection_format.inspect}"
418
416
  end
419
417
  end
420
418
  end