hubspot-api-client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/hubspot-api-client.rb +3 -2
  4. data/lib/hubspot/codegen/crm/associations/api/batch_api.rb +3 -3
  5. data/lib/hubspot/codegen/crm/associations/api/types_api.rb +94 -0
  6. data/lib/hubspot/codegen/crm/associations/api_client.rb +1 -0
  7. data/lib/hubspot/codegen/crm/associations/models/associated_id.rb +229 -0
  8. data/lib/hubspot/codegen/crm/associations/models/batch_input_public_object_id.rb +1 -1
  9. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association.rb +0 -5
  10. data/lib/hubspot/codegen/crm/associations/models/batch_response_public_association_multi.rb +0 -5
  11. data/lib/hubspot/codegen/crm/associations/models/collection_response_public_association_definiton.rb +226 -0
  12. data/lib/hubspot/codegen/crm/associations/models/error.rb +12 -2
  13. data/lib/hubspot/codegen/crm/associations/models/error_detail.rb +20 -23
  14. data/lib/hubspot/codegen/crm/associations/models/next_page.rb +224 -0
  15. data/lib/hubspot/codegen/crm/associations/models/paging.rb +210 -0
  16. data/lib/hubspot/codegen/crm/associations/models/public_association.rb +19 -5
  17. data/lib/hubspot/codegen/crm/associations/models/public_association_definiton.rb +229 -0
  18. data/lib/hubspot/codegen/crm/associations/models/public_association_multi.rb +2 -2
  19. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +42 -30
  20. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +8 -5
  21. data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +2 -2
  22. data/lib/hubspot/codegen/crm/companies/api_client.rb +1 -0
  23. data/lib/hubspot/codegen/crm/companies/models/associated_id.rb +229 -0
  24. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +11 -2
  25. data/lib/hubspot/codegen/crm/companies/models/batch_response_simple_public_object.rb +1 -6
  26. data/lib/hubspot/codegen/crm/companies/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +5 -5
  27. data/lib/hubspot/codegen/crm/companies/models/error.rb +12 -2
  28. data/lib/hubspot/codegen/crm/companies/models/error_detail.rb +20 -23
  29. data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +2 -12
  30. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_input.rb +1 -1
  31. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +42 -30
  32. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +8 -5
  33. data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +2 -2
  34. data/lib/hubspot/codegen/crm/contacts/api_client.rb +1 -0
  35. data/lib/hubspot/codegen/crm/contacts/models/associated_id.rb +229 -0
  36. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +11 -2
  37. data/lib/hubspot/codegen/crm/contacts/models/batch_response_simple_public_object.rb +1 -6
  38. data/lib/hubspot/codegen/crm/contacts/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +5 -5
  39. data/lib/hubspot/codegen/crm/contacts/models/error.rb +12 -2
  40. data/lib/hubspot/codegen/crm/contacts/models/error_detail.rb +20 -23
  41. data/lib/hubspot/codegen/crm/contacts/models/filter.rb +3 -3
  42. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +2 -12
  43. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +42 -30
  44. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +8 -5
  45. data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +2 -2
  46. data/lib/hubspot/codegen/crm/deals/api_client.rb +1 -0
  47. data/lib/hubspot/codegen/crm/deals/models/associated_id.rb +229 -0
  48. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +11 -2
  49. data/lib/hubspot/codegen/crm/deals/models/batch_response_simple_public_object.rb +1 -6
  50. data/lib/hubspot/codegen/crm/deals/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +5 -5
  51. data/lib/hubspot/codegen/crm/deals/models/error.rb +12 -2
  52. data/lib/hubspot/codegen/crm/deals/models/error_detail.rb +20 -23
  53. data/lib/hubspot/codegen/crm/deals/models/filter.rb +3 -3
  54. data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +2 -12
  55. data/lib/hubspot/codegen/crm/extensions/cards/api/cards_api.rb +36 -36
  56. data/lib/hubspot/codegen/crm/extensions/cards/api_client.rb +1 -0
  57. data/lib/hubspot/codegen/crm/extensions/cards/models/card_actions.rb +5 -3
  58. data/lib/hubspot/codegen/crm/extensions/cards/models/card_create_request.rb +5 -3
  59. data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_body.rb +5 -3
  60. data/lib/hubspot/codegen/crm/extensions/cards/models/card_display_property.rb +8 -3
  61. data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body.rb +6 -3
  62. data/lib/hubspot/codegen/crm/extensions/cards/models/card_fetch_body_patch.rb +7 -4
  63. data/lib/hubspot/codegen/crm/extensions/cards/models/card_list_response.rb +5 -3
  64. data/lib/hubspot/codegen/crm/extensions/cards/models/card_object_type_body.rb +5 -3
  65. data/lib/hubspot/codegen/crm/extensions/cards/models/card_patch_request.rb +5 -3
  66. data/lib/hubspot/codegen/crm/extensions/cards/models/card_response.rb +8 -3
  67. data/lib/hubspot/codegen/crm/extensions/cards/models/display_option.rb +7 -3
  68. data/lib/hubspot/codegen/crm/extensions/cards/models/error.rb +12 -2
  69. data/lib/hubspot/codegen/crm/extensions/cards/models/error_detail.rb +24 -4
  70. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +42 -30
  71. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +8 -5
  72. data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +2 -2
  73. data/lib/hubspot/codegen/crm/line_items/api_client.rb +1 -0
  74. data/lib/hubspot/codegen/crm/line_items/models/associated_id.rb +229 -0
  75. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +11 -2
  76. data/lib/hubspot/codegen/crm/line_items/models/batch_response_simple_public_object.rb +1 -6
  77. data/lib/hubspot/codegen/crm/line_items/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +5 -5
  78. data/lib/hubspot/codegen/crm/line_items/models/error.rb +12 -2
  79. data/lib/hubspot/codegen/crm/line_items/models/error_detail.rb +20 -23
  80. data/lib/hubspot/codegen/crm/line_items/models/filter.rb +3 -3
  81. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object.rb +2 -12
  82. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +2 -2
  83. data/lib/hubspot/codegen/crm/owners/api_client.rb +1 -0
  84. data/lib/hubspot/codegen/crm/owners/models/collection_response_public_owner.rb +1 -1
  85. data/lib/hubspot/codegen/crm/owners/models/error.rb +12 -2
  86. data/lib/hubspot/codegen/crm/owners/models/error_detail.rb +22 -2
  87. data/lib/hubspot/codegen/crm/owners/models/public_owner.rb +1 -6
  88. data/lib/hubspot/codegen/crm/pipelines/api/pipeline_stages_api.rb +6 -6
  89. data/lib/hubspot/codegen/crm/pipelines/api/pipelines_api.rb +7 -7
  90. data/lib/hubspot/codegen/crm/pipelines/api_client.rb +1 -0
  91. data/lib/hubspot/codegen/crm/pipelines/models/error.rb +12 -2
  92. data/lib/hubspot/codegen/crm/pipelines/models/error_detail.rb +22 -2
  93. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +43 -31
  94. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +9 -6
  95. data/lib/hubspot/codegen/crm/products/api/batch_api.rb +3 -3
  96. data/lib/hubspot/codegen/crm/products/api_client.rb +1 -0
  97. data/lib/hubspot/codegen/crm/products/models/associated_id.rb +229 -0
  98. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +11 -2
  99. data/lib/hubspot/codegen/crm/products/models/batch_response_simple_public_object.rb +1 -6
  100. data/lib/hubspot/codegen/crm/products/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +5 -5
  101. data/lib/hubspot/codegen/crm/products/models/error.rb +12 -2
  102. data/lib/hubspot/codegen/crm/products/models/error_detail.rb +20 -23
  103. data/lib/hubspot/codegen/crm/products/models/filter.rb +3 -3
  104. data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +2 -12
  105. data/lib/hubspot/codegen/crm/products/models/simple_public_object_id.rb +1 -1
  106. data/lib/hubspot/codegen/crm/products/models/simple_public_object_input.rb +1 -1
  107. data/lib/hubspot/codegen/crm/properties/api/batch_api.rb +4 -4
  108. data/lib/hubspot/codegen/crm/properties/api/core_api.rb +6 -6
  109. data/lib/hubspot/codegen/crm/properties/api/groups_api.rb +6 -6
  110. data/lib/hubspot/codegen/crm/properties/api_client.rb +1 -0
  111. data/lib/hubspot/codegen/crm/properties/models/error.rb +12 -2
  112. data/lib/hubspot/codegen/crm/properties/models/error_detail.rb +20 -23
  113. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +43 -31
  114. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +9 -6
  115. data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +3 -3
  116. data/lib/hubspot/codegen/crm/quotes/api_client.rb +1 -0
  117. data/lib/hubspot/codegen/crm/quotes/models/associated_id.rb +229 -0
  118. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +11 -2
  119. data/lib/hubspot/codegen/crm/quotes/models/batch_response_simple_public_object.rb +1 -6
  120. data/lib/hubspot/codegen/crm/quotes/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +5 -5
  121. data/lib/hubspot/codegen/crm/quotes/models/error.rb +12 -2
  122. data/lib/hubspot/codegen/crm/quotes/models/error_detail.rb +20 -23
  123. data/lib/hubspot/codegen/crm/quotes/models/filter.rb +4 -4
  124. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object.rb +2 -12
  125. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +43 -31
  126. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +9 -6
  127. data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +3 -3
  128. data/lib/hubspot/codegen/crm/tickets/api_client.rb +1 -0
  129. data/lib/hubspot/codegen/crm/tickets/models/associated_id.rb +229 -0
  130. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +11 -2
  131. data/lib/hubspot/codegen/crm/tickets/models/batch_response_simple_public_object.rb +1 -6
  132. data/lib/hubspot/codegen/crm/tickets/models/{collection_response_simple_public_object_id.rb → collection_response_associated_id.rb} +6 -6
  133. data/lib/hubspot/codegen/crm/tickets/models/error.rb +12 -2
  134. data/lib/hubspot/codegen/crm/tickets/models/error_detail.rb +20 -23
  135. data/lib/hubspot/codegen/crm/tickets/models/filter.rb +3 -3
  136. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +2 -12
  137. data/lib/hubspot/codegen/crm/timeline/api/events_api.rb +353 -0
  138. data/lib/hubspot/codegen/crm/timeline/api/templates_api.rb +362 -0
  139. data/lib/hubspot/codegen/crm/timeline/api/tokens_api.rb +250 -0
  140. data/lib/hubspot/codegen/crm/{objects → timeline}/api_client.rb +6 -5
  141. data/lib/hubspot/codegen/crm/{objects → timeline}/api_error.rb +4 -4
  142. data/lib/hubspot/codegen/crm/{objects → timeline}/configuration.rb +6 -6
  143. data/lib/hubspot/codegen/crm/timeline/models/add_numbers.rb +280 -0
  144. data/lib/hubspot/codegen/crm/timeline/models/batch_input_timeline_event.rb +219 -0
  145. data/lib/hubspot/codegen/crm/{objects/models/batch_response_simple_public_object.rb → timeline/models/batch_response_timeline_event_response.rb} +17 -14
  146. data/lib/hubspot/codegen/crm/timeline/models/begins_with.rb +294 -0
  147. data/lib/hubspot/codegen/crm/timeline/models/boolean_property_variable.rb +280 -0
  148. data/lib/hubspot/codegen/crm/timeline/models/collection_response_timeline_event_template.rb +228 -0
  149. data/lib/hubspot/codegen/crm/timeline/models/concat_strings.rb +280 -0
  150. data/lib/hubspot/codegen/crm/timeline/models/constant_boolean.rb +280 -0
  151. data/lib/hubspot/codegen/crm/timeline/models/constant_number.rb +280 -0
  152. data/lib/hubspot/codegen/crm/timeline/models/constant_string.rb +280 -0
  153. data/lib/hubspot/codegen/crm/timeline/models/contains.rb +294 -0
  154. data/lib/hubspot/codegen/crm/timeline/models/date.rb +280 -0
  155. data/lib/hubspot/codegen/crm/timeline/models/divide_numbers.rb +280 -0
  156. data/lib/hubspot/codegen/crm/{objects → timeline}/models/error.rb +18 -8
  157. data/lib/hubspot/codegen/crm/{objects → timeline}/models/error_detail.rb +26 -29
  158. data/lib/hubspot/codegen/crm/timeline/models/event_detail.rb +217 -0
  159. data/lib/hubspot/codegen/crm/timeline/models/extract_most_recent_email_reply_html.rb +280 -0
  160. data/lib/hubspot/codegen/crm/timeline/models/extract_most_recent_email_reply_text.rb +280 -0
  161. data/lib/hubspot/codegen/crm/timeline/models/extract_most_recent_plain_text_email_reply.rb +280 -0
  162. data/lib/hubspot/codegen/crm/timeline/models/fetch_exchange_rate.rb +280 -0
  163. data/lib/hubspot/codegen/crm/{objects/models/batch_input_simple_public_object_input.rb → timeline/models/has_email_reply.rb} +78 -15
  164. data/lib/hubspot/codegen/crm/timeline/models/has_plain_text_email_reply.rb +280 -0
  165. data/lib/hubspot/codegen/crm/timeline/models/if_boolean.rb +303 -0
  166. data/lib/hubspot/codegen/crm/timeline/models/if_number.rb +303 -0
  167. data/lib/hubspot/codegen/crm/timeline/models/if_string.rb +303 -0
  168. data/lib/hubspot/codegen/crm/timeline/models/is_present.rb +294 -0
  169. data/lib/hubspot/codegen/crm/timeline/models/less_than.rb +280 -0
  170. data/lib/hubspot/codegen/crm/timeline/models/less_than_or_equal.rb +280 -0
  171. data/lib/hubspot/codegen/crm/timeline/models/lower_case.rb +280 -0
  172. data/lib/hubspot/codegen/crm/timeline/models/max_numbers.rb +280 -0
  173. data/lib/hubspot/codegen/crm/timeline/models/min_numbers.rb +280 -0
  174. data/lib/hubspot/codegen/crm/timeline/models/model_and.rb +280 -0
  175. data/lib/hubspot/codegen/crm/timeline/models/model_not.rb +280 -0
  176. data/lib/hubspot/codegen/crm/timeline/models/model_or.rb +280 -0
  177. data/lib/hubspot/codegen/crm/{objects/models/filter.rb → timeline/models/month.rb} +36 -28
  178. data/lib/hubspot/codegen/crm/timeline/models/more_than.rb +280 -0
  179. data/lib/hubspot/codegen/crm/timeline/models/more_than_or_equal.rb +280 -0
  180. data/lib/hubspot/codegen/crm/timeline/models/multiply_numbers.rb +280 -0
  181. data/lib/hubspot/codegen/crm/timeline/models/next_page.rb +224 -0
  182. data/lib/hubspot/codegen/crm/{objects/models/batch_input_simple_public_object_id.rb → timeline/models/now.rb} +78 -15
  183. data/lib/hubspot/codegen/crm/timeline/models/number_equals.rb +280 -0
  184. data/lib/hubspot/codegen/crm/timeline/models/number_property_variable.rb +280 -0
  185. data/lib/hubspot/codegen/crm/timeline/models/number_to_string.rb +280 -0
  186. data/lib/hubspot/codegen/crm/timeline/models/paging.rb +210 -0
  187. data/lib/hubspot/codegen/crm/timeline/models/parse_number.rb +280 -0
  188. data/lib/hubspot/codegen/crm/timeline/models/period_to_months.rb +280 -0
  189. data/lib/hubspot/codegen/crm/timeline/models/pipeline_probability.rb +280 -0
  190. data/lib/hubspot/codegen/crm/timeline/models/round_down_numbers.rb +280 -0
  191. data/lib/hubspot/codegen/crm/timeline/models/round_up_numbers.rb +280 -0
  192. data/lib/hubspot/codegen/crm/timeline/models/string_equals.rb +280 -0
  193. data/lib/hubspot/codegen/crm/timeline/models/string_property_variable.rb +280 -0
  194. data/lib/hubspot/codegen/crm/timeline/models/subtract_numbers.rb +280 -0
  195. data/lib/hubspot/codegen/crm/timeline/models/time_between.rb +280 -0
  196. data/lib/hubspot/codegen/crm/{objects/models/public_object_search_request.rb → timeline/models/timeline_event.rb} +101 -69
  197. data/lib/hubspot/codegen/crm/{objects/models/simple_public_object_id.rb → timeline/models/timeline_event_i_frame.rb} +79 -18
  198. data/lib/hubspot/codegen/crm/timeline/models/timeline_event_response.rb +342 -0
  199. data/lib/hubspot/codegen/crm/{objects/models/simple_public_object.rb → timeline/models/timeline_event_template.rb} +62 -56
  200. data/lib/hubspot/codegen/crm/{objects/models/batch_read_input_simple_public_object_id.rb → timeline/models/timeline_event_template_create_request.rb} +63 -36
  201. data/lib/hubspot/codegen/crm/timeline/models/timeline_event_template_token.rb +328 -0
  202. data/lib/hubspot/codegen/crm/timeline/models/timeline_event_template_token_option.rb +229 -0
  203. data/lib/hubspot/codegen/crm/timeline/models/timeline_event_template_token_update_request.rb +244 -0
  204. data/lib/hubspot/codegen/crm/{objects/models/simple_public_object_batch_input.rb → timeline/models/timeline_event_template_update_request.rb} +57 -19
  205. data/lib/hubspot/codegen/crm/timeline/models/upper_case.rb +280 -0
  206. data/lib/hubspot/codegen/crm/timeline/models/xor.rb +280 -0
  207. data/lib/hubspot/codegen/crm/timeline/models/year.rb +280 -0
  208. data/lib/hubspot/codegen/oauth/api/default_api.rb +270 -0
  209. data/lib/hubspot/codegen/oauth/api_client.rb +3 -4
  210. data/lib/hubspot/codegen/oauth/configuration.rb +3 -3
  211. data/lib/hubspot/codegen/oauth/models/error.rb +14 -25
  212. data/lib/hubspot/codegen/oauth/models/error_detail.rb +26 -6
  213. data/lib/hubspot/codegen/oauth/models/{refresh_token.rb → token_response_if.rb} +33 -47
  214. data/lib/hubspot/codegen/webhooks/api/settings_api.rb +214 -0
  215. data/lib/hubspot/codegen/webhooks/api/subscriptions_api.rb +360 -0
  216. data/lib/hubspot/codegen/webhooks/api_client.rb +420 -0
  217. data/lib/hubspot/codegen/webhooks/api_error.rb +59 -0
  218. data/lib/hubspot/codegen/webhooks/configuration.rb +256 -0
  219. data/lib/hubspot/codegen/webhooks/models/error.rb +290 -0
  220. data/lib/hubspot/codegen/webhooks/models/error_detail.rb +256 -0
  221. data/lib/hubspot/codegen/webhooks/models/settings_change_request.rb +229 -0
  222. data/lib/hubspot/codegen/webhooks/models/settings_response.rb +254 -0
  223. data/lib/hubspot/codegen/webhooks/models/subscription_create_request.rb +268 -0
  224. data/lib/hubspot/codegen/webhooks/models/subscription_list_response.rb +217 -0
  225. data/lib/hubspot/codegen/webhooks/models/subscription_patch_request.rb +210 -0
  226. data/lib/hubspot/codegen/{oauth/models/json_node.rb → webhooks/models/subscription_response.rb} +75 -189
  227. data/lib/hubspot/codegen/webhooks/models/throttling_settings.rb +264 -0
  228. data/lib/hubspot/version.rb +1 -1
  229. data/sample-apps/companies-app/Gemfile.lock +2 -2
  230. data/sample-apps/companies-app/app/lib/services/authorization/tokens/generate.rb +2 -2
  231. data/sample-apps/companies-app/app/lib/services/authorization/tokens/refresh.rb +2 -2
  232. data/sample-apps/companies-app/app/lib/services/hubspot/associations/create.rb +3 -2
  233. data/sample-apps/companies-app/app/lib/services/hubspot/associations/delete.rb +3 -2
  234. data/sample-apps/contacts-app/Gemfile.lock +2 -2
  235. data/sample-apps/contacts-app/app/lib/services/authorization/tokens/generate.rb +2 -2
  236. data/sample-apps/contacts-app/app/lib/services/authorization/tokens/refresh.rb +2 -2
  237. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/create.rb +1 -1
  238. data/sample-apps/contacts-app/app/lib/services/hubspot/contacts/update.rb +1 -1
  239. data/sample-apps/contacts-app/app/views/contacts/show.html.erb +1 -0
  240. data/sample-apps/leaky-bucket-app/Gemfile.lock +2 -2
  241. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/tokens/generate.rb +2 -2
  242. data/sample-apps/leaky-bucket-app/app/lib/services/authorization/tokens/refresh.rb +2 -2
  243. data/sample-apps/oauth-app/Gemfile.lock +2 -2
  244. data/sample-apps/oauth-app/app/lib/services/authorization/tokens/generate.rb +2 -2
  245. data/sample-apps/oauth-app/app/lib/services/authorization/tokens/refresh.rb +2 -2
  246. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/create.rb +1 -1
  247. data/sample-apps/oauth-app/app/lib/services/hubspot/contacts/update.rb +1 -1
  248. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/tokens/generate.rb +2 -2
  249. data/sample-apps/rate-limits-redis-sample-app/app/lib/services/authorization/tokens/refresh.rb +2 -2
  250. data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/generate.rb +2 -2
  251. data/sample-apps/retry-middleware-sample-app/app/lib/services/authorization/tokens/refresh.rb +2 -2
  252. metadata +170 -90
  253. data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +0 -254
  254. data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +0 -389
  255. data/lib/hubspot/codegen/crm/objects/api/batch_api.rb +0 -293
  256. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +0 -92
  257. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_batch_input.rb +0 -217
  258. data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object.rb +0 -226
  259. data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object_id.rb +0 -226
  260. data/lib/hubspot/codegen/crm/objects/models/collection_response_with_total_simple_public_object.rb +0 -241
  261. data/lib/hubspot/codegen/crm/objects/models/filter_group.rb +0 -217
  262. data/lib/hubspot/codegen/crm/objects/models/next_page.rb +0 -224
  263. data/lib/hubspot/codegen/crm/objects/models/paging.rb +0 -210
  264. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_input.rb +0 -217
  265. data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +0 -84
  266. data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +0 -336
  267. data/lib/hubspot/codegen/oauth/api/tokens_api.rb +0 -98
  268. data/spec/objects/api/associations_api_spec.rb +0 -76
  269. data/spec/objects/api/basic_api_spec.rb +0 -108
  270. data/spec/objects/api/batch_api_spec.rb +0 -88
  271. data/spec/objects/api/search_api_spec.rb +0 -48
  272. data/spec/objects/api_client_spec.rb +0 -226
  273. data/spec/objects/configuration_spec.rb +0 -42
  274. data/spec/objects/models/batch_input_simple_public_object_batch_input_spec.rb +0 -41
  275. data/spec/objects/models/batch_input_simple_public_object_id_spec.rb +0 -41
  276. data/spec/objects/models/batch_input_simple_public_object_input_spec.rb +0 -41
  277. data/spec/objects/models/batch_read_input_simple_public_object_id_spec.rb +0 -47
  278. data/spec/objects/models/batch_response_simple_public_object_spec.rb +0 -81
  279. data/spec/objects/models/collection_response_simple_public_object_id_spec.rb +0 -47
  280. data/spec/objects/models/collection_response_simple_public_object_spec.rb +0 -47
  281. data/spec/objects/models/collection_response_with_total_simple_public_object_spec.rb +0 -53
  282. data/spec/objects/models/error_detail_spec.rb +0 -65
  283. data/spec/objects/models/error_spec.rb +0 -71
  284. data/spec/objects/models/filter_group_spec.rb +0 -41
  285. data/spec/objects/models/filter_spec.rb +0 -57
  286. data/spec/objects/models/next_page_spec.rb +0 -47
  287. data/spec/objects/models/paging_spec.rb +0 -41
  288. data/spec/objects/models/public_object_search_request_spec.rb +0 -71
  289. data/spec/objects/models/simple_public_object_batch_input_spec.rb +0 -47
  290. data/spec/objects/models/simple_public_object_id_spec.rb +0 -41
  291. data/spec/objects/models/simple_public_object_input_spec.rb +0 -41
  292. data/spec/objects/models/simple_public_object_spec.rb +0 -77
@@ -0,0 +1,264 @@
1
+ =begin
2
+ #Webhooks API
3
+
4
+ #Provides a way for apps to subscribe to certain change events in HubSpot. Once configured, apps will receive event payloads containing details about the changes at a specified target URL. There can only be one target URL for receiving event notifications per app.
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Hubspot
16
+ module Webhooks
17
+ # Configuration details for webhook throttling.
18
+ class ThrottlingSettings
19
+ # The maximum number of HTTP requests HubSpot will attempt to make to your app in a given time frame determined by `period`.
20
+ attr_accessor :max_concurrent_requests
21
+
22
+ # Time scale for this setting. Can be either `SECONDLY` (per second) or `ROLLING_MINUTE` (per minute).
23
+ attr_accessor :period
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'max_concurrent_requests' => :'maxConcurrentRequests',
51
+ :'period' => :'period'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'max_concurrent_requests' => :'Integer',
59
+ :'period' => :'String'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Webhooks::ThrottlingSettings` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!self.class.attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Webhooks::ThrottlingSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'max_concurrent_requests')
85
+ self.max_concurrent_requests = attributes[:'max_concurrent_requests']
86
+ end
87
+
88
+ if attributes.key?(:'period')
89
+ self.period = attributes[:'period']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if @max_concurrent_requests.nil?
98
+ invalid_properties.push('invalid value for "max_concurrent_requests", max_concurrent_requests cannot be nil.')
99
+ end
100
+
101
+ if @period.nil?
102
+ invalid_properties.push('invalid value for "period", period cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if @max_concurrent_requests.nil?
112
+ return false if @period.nil?
113
+ period_validator = EnumAttributeValidator.new('String', ["SECONDLY", "ROLLING_MINUTE"])
114
+ return false unless period_validator.valid?(@period)
115
+ true
116
+ end
117
+
118
+ # Custom attribute writer method checking allowed values (enum).
119
+ # @param [Object] period Object to be assigned
120
+ def period=(period)
121
+ validator = EnumAttributeValidator.new('String', ["SECONDLY", "ROLLING_MINUTE"])
122
+ unless validator.valid?(period)
123
+ fail ArgumentError, "invalid value for \"period\", must be one of #{validator.allowable_values}."
124
+ end
125
+ @period = period
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ max_concurrent_requests == o.max_concurrent_requests &&
134
+ period == o.period
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [max_concurrent_requests, period].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.openapi_types.each_pair do |key, type|
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :DateTime
183
+ DateTime.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :Boolean
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ Hubspot::Webhooks.const_get(type).build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+ end
263
+ end
264
+ end
@@ -1,3 +1,3 @@
1
1
  module Hubspot
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- hubspot-api-client (1.0.0)
4
+ hubspot-api-client (2.0.0)
5
5
  faraday (>= 0.14.0)
6
6
  json (~> 2.1, >= 2.1.0)
7
7
 
@@ -84,7 +84,7 @@ GEM
84
84
  railties (>= 3.2, < 6.1)
85
85
  erubi (1.9.0)
86
86
  execjs (2.7.0)
87
- faraday (1.0.0)
87
+ faraday (1.0.1)
88
88
  multipart-post (>= 1.2, < 3)
89
89
  ffi (1.11.1)
90
90
  geckodriver-helper (0.24.0)
@@ -8,8 +8,8 @@ module Services
8
8
  end
9
9
 
10
10
  def call
11
- tokens_api = ::Hubspot::OAuth::TokensApi.new
12
- tokens = tokens_api.post_oauth_v1_token(
11
+ default_api = ::Hubspot::OAuth::DefaultApi.new
12
+ tokens = default_api.create_token(
13
13
  grant_type: :authorization_code,
14
14
  code: @code,
15
15
  redirect_uri: redirect_uri,
@@ -15,8 +15,8 @@ module Services
15
15
  private
16
16
 
17
17
  def refresh_tokens
18
- tokens_api = ::Hubspot::OAuth::TokensApi.new
19
- tokens = tokens_api.post_oauth_v1_token(
18
+ default_api = ::Hubspot::OAuth::DefaultApi.new
19
+ tokens = default_api.create_token(
20
20
  grant_type: :refresh_token,
21
21
  refresh_token: @tokens[:refresh_token],
22
22
  redirect_uri: redirect_uri,
@@ -11,7 +11,7 @@ module Services
11
11
  ::Hubspot::Crm::Associations::BatchApi.new.create_batch(
12
12
  'companies',
13
13
  'contacts',
14
- body: association,
14
+ batch_input_public_association: association,
15
15
  auth_names: 'oauth2'
16
16
  )
17
17
  end
@@ -28,7 +28,8 @@ module Services
28
28
  @contacts_ids.map do |id|
29
29
  ::Hubspot::Crm::Associations::PublicAssociation.new(
30
30
  from: ::Hubspot::Crm::Associations::PublicObjectId.new(id: @company_id),
31
- to: ::Hubspot::Crm::Associations::PublicObjectId.new(id: id)
31
+ to: ::Hubspot::Crm::Associations::PublicObjectId.new(id: id),
32
+ type: 'company_to_contact'
32
33
  )
33
34
  end
34
35
  end
@@ -11,7 +11,7 @@ module Services
11
11
  ::Hubspot::Crm::Associations::BatchApi.new.archive_batch(
12
12
  'companies',
13
13
  'contacts',
14
- body: association,
14
+ batch_input_public_association: association,
15
15
  auth_names: 'oauth2'
16
16
  )
17
17
  end
@@ -28,7 +28,8 @@ module Services
28
28
  @contacts_ids.map do |id|
29
29
  ::Hubspot::Crm::Associations::PublicAssociation.new(
30
30
  from: ::Hubspot::Crm::Associations::PublicObjectId.new(id: @company_id),
31
- to: ::Hubspot::Crm::Associations::PublicObjectId.new(id: id)
31
+ to: ::Hubspot::Crm::Associations::PublicObjectId.new(id: id),
32
+ type: 'company_to_contact'
32
33
  )
33
34
  end
34
35
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- hubspot-api-client (1.0.0)
4
+ hubspot-api-client (2.0.0)
5
5
  faraday (>= 0.14.0)
6
6
  json (~> 2.1, >= 2.1.0)
7
7
 
@@ -84,7 +84,7 @@ GEM
84
84
  railties (>= 3.2, < 6.1)
85
85
  erubi (1.9.0)
86
86
  execjs (2.7.0)
87
- faraday (1.0.0)
87
+ faraday (1.0.1)
88
88
  multipart-post (>= 1.2, < 3)
89
89
  ffi (1.11.1)
90
90
  geckodriver-helper (0.24.0)
@@ -8,8 +8,8 @@ module Services
8
8
  end
9
9
 
10
10
  def call
11
- tokens_api = ::Hubspot::OAuth::TokensApi.new
12
- tokens = tokens_api.post_oauth_v1_token(
11
+ default_api = ::Hubspot::OAuth::DefaultApi.new
12
+ tokens = default_api.create_token(
13
13
  grant_type: :authorization_code,
14
14
  code: @code,
15
15
  redirect_uri: redirect_uri,
@@ -15,8 +15,8 @@ module Services
15
15
  private
16
16
 
17
17
  def refresh_tokens
18
- tokens_api = ::Hubspot::OAuth::TokensApi.new
19
- tokens = tokens_api.post_oauth_v1_token(
18
+ default_api = ::Hubspot::OAuth::DefaultApi.new
19
+ tokens = default_api.create_token(
20
20
  grant_type: :refresh_token,
21
21
  refresh_token: @tokens[:refresh_token],
22
22
  redirect_uri: redirect_uri,
@@ -14,7 +14,7 @@ module Services
14
14
  private
15
15
 
16
16
  def contact_input
17
- @contact_input ||= ::Hubspot::Crm::Objects::SimplePublicObjectInput.new(properties: @properties)
17
+ @contact_input ||= ::Hubspot::Crm::Contacts::SimplePublicObjectInput.new(properties: @properties)
18
18
  end
19
19
  end
20
20
  end
@@ -16,7 +16,7 @@ module Services
16
16
  private
17
17
 
18
18
  def contact_input
19
- @contact_input ||= ::Hubspot::Crm::Objects::SimplePublicObjectInput.new(properties: @properties)
19
+ @contact_input ||= ::Hubspot::Crm::Contacts::SimplePublicObjectInput.new(properties: @properties)
20
20
  end
21
21
  end
22
22
  end
@@ -11,6 +11,7 @@
11
11
  <h3>Properties</h3>
12
12
  <%= form_for :contact, url: "/contacts/#{params[:id]}", method: 'put' do |form| %>
13
13
  <% @contact.properties.each do |property_key, property_value| %>
14
+ <% next if @properties.find { |p| p.name == property_key }.modification_metadata.read_only_value %>
14
15
  <%= label(:contact, property_key, @properties.find { |p| p.name == property_key }.label) %>
15
16
  <% if property_key == 'hubspot_owner_id' %>
16
17
  <%= select(
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- hubspot-api-client (1.0.0)
4
+ hubspot-api-client (2.0.0)
5
5
  faraday (>= 0.14.0)
6
6
  json (~> 2.1, >= 2.1.0)
7
7
 
@@ -85,7 +85,7 @@ GEM
85
85
  railties (>= 3.2, < 6.1)
86
86
  erubi (1.9.0)
87
87
  execjs (2.7.0)
88
- faraday (1.0.0)
88
+ faraday (1.0.1)
89
89
  multipart-post (>= 1.2, < 3)
90
90
  ffi (1.11.1)
91
91
  geckodriver-helper (0.24.0)
@@ -8,8 +8,8 @@ module Services
8
8
  end
9
9
 
10
10
  def call
11
- tokens_api = ::Hubspot::OAuth::TokensApi.new
12
- tokens = tokens_api.post_oauth_v1_token(
11
+ default_api = ::Hubspot::OAuth::DefaultApi.new
12
+ tokens = default_api.create_token(
13
13
  grant_type: :authorization_code,
14
14
  code: @code,
15
15
  redirect_uri: redirect_uri,