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
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #CRM Objects
2
+ #Timeline events
3
3
 
4
- #CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are native objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
4
+ #This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM object like contacts, companies, or deals. You'll find multiple use cases for this API in the sections below.
5
5
 
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
 
@@ -14,32 +14,44 @@ require 'date'
14
14
 
15
15
  module Hubspot
16
16
  module Crm
17
- module Objects
18
- class SimplePublicObject
17
+ module Timeline
18
+ # The current state of the template definition.
19
+ class TimelineEventTemplate
20
+ # The template ID.
19
21
  attr_accessor :id
20
22
 
21
- attr_accessor :properties
23
+ # The type of CRM object you want this template applicable for. Currently we support [contacts, companies, deals].
24
+ attr_accessor :object_type
22
25
 
26
+ # The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.
23
27
  attr_accessor :created_at
24
28
 
29
+ # The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.
25
30
  attr_accessor :updated_at
26
31
 
27
- attr_accessor :associations
32
+ # The template name.
33
+ attr_accessor :name
28
34
 
29
- attr_accessor :archived
35
+ # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.
36
+ attr_accessor :header_template
30
37
 
31
- attr_accessor :archived_at
38
+ # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.
39
+ attr_accessor :detail_template
40
+
41
+ # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.
42
+ attr_accessor :tokens
32
43
 
33
44
  # Attribute mapping from ruby-style variable name to JSON key.
34
45
  def self.attribute_map
35
46
  {
36
47
  :'id' => :'id',
37
- :'properties' => :'properties',
48
+ :'object_type' => :'objectType',
38
49
  :'created_at' => :'createdAt',
39
50
  :'updated_at' => :'updatedAt',
40
- :'associations' => :'associations',
41
- :'archived' => :'archived',
42
- :'archived_at' => :'archivedAt'
51
+ :'name' => :'name',
52
+ :'header_template' => :'headerTemplate',
53
+ :'detail_template' => :'detailTemplate',
54
+ :'tokens' => :'tokens'
43
55
  }
44
56
  end
45
57
 
@@ -47,12 +59,13 @@ module Hubspot
47
59
  def self.openapi_types
48
60
  {
49
61
  :'id' => :'String',
50
- :'properties' => :'Hash<String, String>',
62
+ :'object_type' => :'String',
51
63
  :'created_at' => :'DateTime',
52
64
  :'updated_at' => :'DateTime',
53
- :'associations' => :'Hash<String, CollectionResponseSimplePublicObjectId>',
54
- :'archived' => :'Boolean',
55
- :'archived_at' => :'DateTime'
65
+ :'name' => :'String',
66
+ :'header_template' => :'String',
67
+ :'detail_template' => :'String',
68
+ :'tokens' => :'Array<TimelineEventTemplateToken>'
56
69
  }
57
70
  end
58
71
 
@@ -66,13 +79,13 @@ module Hubspot
66
79
  # @param [Hash] attributes Model attributes in the form of hash
67
80
  def initialize(attributes = {})
68
81
  if (!attributes.is_a?(Hash))
69
- fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Objects::SimplePublicObject` initialize method"
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Timeline::TimelineEventTemplate` initialize method"
70
83
  end
71
84
 
72
85
  # check to see if the attribute exists and convert string to symbol for hash key
73
86
  attributes = attributes.each_with_object({}) { |(k, v), h|
74
87
  if (!self.class.attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Objects::SimplePublicObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Timeline::TimelineEventTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
89
  end
77
90
  h[k.to_sym] = v
78
91
  }
@@ -81,10 +94,8 @@ module Hubspot
81
94
  self.id = attributes[:'id']
82
95
  end
83
96
 
84
- if attributes.key?(:'properties')
85
- if (value = attributes[:'properties']).is_a?(Hash)
86
- self.properties = value
87
- end
97
+ if attributes.key?(:'object_type')
98
+ self.object_type = attributes[:'object_type']
88
99
  end
89
100
 
90
101
  if attributes.key?(:'created_at')
@@ -95,18 +106,22 @@ module Hubspot
95
106
  self.updated_at = attributes[:'updated_at']
96
107
  end
97
108
 
98
- if attributes.key?(:'associations')
99
- if (value = attributes[:'associations']).is_a?(Hash)
100
- self.associations = value
101
- end
109
+ if attributes.key?(:'name')
110
+ self.name = attributes[:'name']
111
+ end
112
+
113
+ if attributes.key?(:'header_template')
114
+ self.header_template = attributes[:'header_template']
102
115
  end
103
116
 
104
- if attributes.key?(:'archived')
105
- self.archived = attributes[:'archived']
117
+ if attributes.key?(:'detail_template')
118
+ self.detail_template = attributes[:'detail_template']
106
119
  end
107
120
 
108
- if attributes.key?(:'archived_at')
109
- self.archived_at = attributes[:'archived_at']
121
+ if attributes.key?(:'tokens')
122
+ if (value = attributes[:'tokens']).is_a?(Array)
123
+ self.tokens = value
124
+ end
110
125
  end
111
126
  end
112
127
 
@@ -118,24 +133,16 @@ module Hubspot
118
133
  invalid_properties.push('invalid value for "id", id cannot be nil.')
119
134
  end
120
135
 
121
- if @properties.nil?
122
- invalid_properties.push('invalid value for "properties", properties cannot be nil.')
123
- end
124
-
125
- if @created_at.nil?
126
- invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
127
- end
128
-
129
- if @updated_at.nil?
130
- invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
136
+ if @object_type.nil?
137
+ invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
131
138
  end
132
139
 
133
- if @associations.nil?
134
- invalid_properties.push('invalid value for "associations", associations cannot be nil.')
140
+ if @name.nil?
141
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
135
142
  end
136
143
 
137
- if @archived.nil?
138
- invalid_properties.push('invalid value for "archived", archived cannot be nil.')
144
+ if @tokens.nil?
145
+ invalid_properties.push('invalid value for "tokens", tokens cannot be nil.')
139
146
  end
140
147
 
141
148
  invalid_properties
@@ -145,11 +152,9 @@ module Hubspot
145
152
  # @return true if the model is valid
146
153
  def valid?
147
154
  return false if @id.nil?
148
- return false if @properties.nil?
149
- return false if @created_at.nil?
150
- return false if @updated_at.nil?
151
- return false if @associations.nil?
152
- return false if @archived.nil?
155
+ return false if @object_type.nil?
156
+ return false if @name.nil?
157
+ return false if @tokens.nil?
153
158
  true
154
159
  end
155
160
 
@@ -159,12 +164,13 @@ module Hubspot
159
164
  return true if self.equal?(o)
160
165
  self.class == o.class &&
161
166
  id == o.id &&
162
- properties == o.properties &&
167
+ object_type == o.object_type &&
163
168
  created_at == o.created_at &&
164
169
  updated_at == o.updated_at &&
165
- associations == o.associations &&
166
- archived == o.archived &&
167
- archived_at == o.archived_at
170
+ name == o.name &&
171
+ header_template == o.header_template &&
172
+ detail_template == o.detail_template &&
173
+ tokens == o.tokens
168
174
  end
169
175
 
170
176
  # @see the `==` method
@@ -176,7 +182,7 @@ module Hubspot
176
182
  # Calculates hash code according to all attributes.
177
183
  # @return [Integer] Hash code
178
184
  def hash
179
- [id, properties, created_at, updated_at, associations, archived, archived_at].hash
185
+ [id, object_type, created_at, updated_at, name, header_template, detail_template, tokens].hash
180
186
  end
181
187
 
182
188
  # Builds the object from hash
@@ -243,7 +249,7 @@ module Hubspot
243
249
  end
244
250
  end
245
251
  else # model
246
- Hubspot::Crm::Objects.const_get(type).build_from_hash(value)
252
+ Hubspot::Crm::Timeline.const_get(type).build_from_hash(value)
247
253
  end
248
254
  end
249
255
 
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #CRM Objects
2
+ #Timeline events
3
3
 
4
- #CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are native objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
4
+ #This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM object like contacts, companies, or deals. You'll find multiple use cases for this API in the sections below.
5
5
 
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
 
@@ -14,29 +14,43 @@ require 'date'
14
14
 
15
15
  module Hubspot
16
16
  module Crm
17
- module Objects
18
- class BatchReadInputSimplePublicObjectId
19
- attr_accessor :properties
17
+ module Timeline
18
+ # State of the template definition being created.
19
+ class TimelineEventTemplateCreateRequest
20
+ # The type of CRM object you want this template applicable for. Currently we support [contacts, companies, deals].
21
+ attr_accessor :object_type
20
22
 
21
- attr_accessor :id_property
23
+ # The template name.
24
+ attr_accessor :name
22
25
 
23
- attr_accessor :inputs
26
+ # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.
27
+ attr_accessor :header_template
28
+
29
+ # This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.
30
+ attr_accessor :detail_template
31
+
32
+ # A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.
33
+ attr_accessor :tokens
24
34
 
25
35
  # Attribute mapping from ruby-style variable name to JSON key.
26
36
  def self.attribute_map
27
37
  {
28
- :'properties' => :'properties',
29
- :'id_property' => :'idProperty',
30
- :'inputs' => :'inputs'
38
+ :'object_type' => :'objectType',
39
+ :'name' => :'name',
40
+ :'header_template' => :'headerTemplate',
41
+ :'detail_template' => :'detailTemplate',
42
+ :'tokens' => :'tokens'
31
43
  }
32
44
  end
33
45
 
34
46
  # Attribute type mapping.
35
47
  def self.openapi_types
36
48
  {
37
- :'properties' => :'Array<String>',
38
- :'id_property' => :'String',
39
- :'inputs' => :'Array<SimplePublicObjectId>'
49
+ :'object_type' => :'String',
50
+ :'name' => :'String',
51
+ :'header_template' => :'String',
52
+ :'detail_template' => :'String',
53
+ :'tokens' => :'Array<TimelineEventTemplateToken>'
40
54
  }
41
55
  end
42
56
 
@@ -50,30 +64,36 @@ module Hubspot
50
64
  # @param [Hash] attributes Model attributes in the form of hash
51
65
  def initialize(attributes = {})
52
66
  if (!attributes.is_a?(Hash))
53
- fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Objects::BatchReadInputSimplePublicObjectId` initialize method"
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Timeline::TimelineEventTemplateCreateRequest` initialize method"
54
68
  end
55
69
 
56
70
  # check to see if the attribute exists and convert string to symbol for hash key
57
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
58
72
  if (!self.class.attribute_map.key?(k.to_sym))
59
- fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Objects::BatchReadInputSimplePublicObjectId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Timeline::TimelineEventTemplateCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
74
  end
61
75
  h[k.to_sym] = v
62
76
  }
63
77
 
64
- if attributes.key?(:'properties')
65
- if (value = attributes[:'properties']).is_a?(Array)
66
- self.properties = value
67
- end
78
+ if attributes.key?(:'object_type')
79
+ self.object_type = attributes[:'object_type']
80
+ end
81
+
82
+ if attributes.key?(:'name')
83
+ self.name = attributes[:'name']
68
84
  end
69
85
 
70
- if attributes.key?(:'id_property')
71
- self.id_property = attributes[:'id_property']
86
+ if attributes.key?(:'header_template')
87
+ self.header_template = attributes[:'header_template']
72
88
  end
73
89
 
74
- if attributes.key?(:'inputs')
75
- if (value = attributes[:'inputs']).is_a?(Array)
76
- self.inputs = value
90
+ if attributes.key?(:'detail_template')
91
+ self.detail_template = attributes[:'detail_template']
92
+ end
93
+
94
+ if attributes.key?(:'tokens')
95
+ if (value = attributes[:'tokens']).is_a?(Array)
96
+ self.tokens = value
77
97
  end
78
98
  end
79
99
  end
@@ -82,12 +102,16 @@ module Hubspot
82
102
  # @return Array for valid properties with the reasons
83
103
  def list_invalid_properties
84
104
  invalid_properties = Array.new
85
- if @properties.nil?
86
- invalid_properties.push('invalid value for "properties", properties cannot be nil.')
105
+ if @object_type.nil?
106
+ invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
107
+ end
108
+
109
+ if @name.nil?
110
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
87
111
  end
88
112
 
89
- if @inputs.nil?
90
- invalid_properties.push('invalid value for "inputs", inputs cannot be nil.')
113
+ if @tokens.nil?
114
+ invalid_properties.push('invalid value for "tokens", tokens cannot be nil.')
91
115
  end
92
116
 
93
117
  invalid_properties
@@ -96,8 +120,9 @@ module Hubspot
96
120
  # Check to see if the all the properties in the model are valid
97
121
  # @return true if the model is valid
98
122
  def valid?
99
- return false if @properties.nil?
100
- return false if @inputs.nil?
123
+ return false if @object_type.nil?
124
+ return false if @name.nil?
125
+ return false if @tokens.nil?
101
126
  true
102
127
  end
103
128
 
@@ -106,9 +131,11 @@ module Hubspot
106
131
  def ==(o)
107
132
  return true if self.equal?(o)
108
133
  self.class == o.class &&
109
- properties == o.properties &&
110
- id_property == o.id_property &&
111
- inputs == o.inputs
134
+ object_type == o.object_type &&
135
+ name == o.name &&
136
+ header_template == o.header_template &&
137
+ detail_template == o.detail_template &&
138
+ tokens == o.tokens
112
139
  end
113
140
 
114
141
  # @see the `==` method
@@ -120,7 +147,7 @@ module Hubspot
120
147
  # Calculates hash code according to all attributes.
121
148
  # @return [Integer] Hash code
122
149
  def hash
123
- [properties, id_property, inputs].hash
150
+ [object_type, name, header_template, detail_template, tokens].hash
124
151
  end
125
152
 
126
153
  # Builds the object from hash
@@ -187,7 +214,7 @@ module Hubspot
187
214
  end
188
215
  end
189
216
  else # model
190
- Hubspot::Crm::Objects.const_get(type).build_from_hash(value)
217
+ Hubspot::Crm::Timeline.const_get(type).build_from_hash(value)
191
218
  end
192
219
  end
193
220
 
@@ -0,0 +1,328 @@
1
+ =begin
2
+ #Timeline events
3
+
4
+ #This feature allows an app to create and configure custom events that can show up in the timelines of certain CRM object like contacts, companies, or deals. You'll find multiple use cases for this API in the sections below.
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 Crm
17
+ module Timeline
18
+ # State of the token definition.
19
+ class TimelineEventTemplateToken
20
+ # The name of the token referenced in the templates. This must be unique for the specific template. It may only contain alphanumeric characters, periods, dashes, or underscores (. - _).
21
+ attr_accessor :name
22
+
23
+ # The data type of the token. You can currently choose from [string, number, date, enumeration].
24
+ attr_accessor :type
25
+
26
+ # The date and time that the Event Template Token was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.
27
+ attr_accessor :created_at
28
+
29
+ # The date and time that the Event Template Token was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.
30
+ attr_accessor :updated_at
31
+
32
+ # Used for list segmentation and reporting.
33
+ attr_accessor :label
34
+
35
+ # The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API.
36
+ attr_accessor :object_property_name
37
+
38
+ # If type is `enumeration`, we should have a list of options to choose from.
39
+ attr_accessor :options
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'name' => :'name',
67
+ :'type' => :'type',
68
+ :'created_at' => :'createdAt',
69
+ :'updated_at' => :'updatedAt',
70
+ :'label' => :'label',
71
+ :'object_property_name' => :'objectPropertyName',
72
+ :'options' => :'options'
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.openapi_types
78
+ {
79
+ :'name' => :'String',
80
+ :'type' => :'String',
81
+ :'created_at' => :'DateTime',
82
+ :'updated_at' => :'DateTime',
83
+ :'label' => :'String',
84
+ :'object_property_name' => :'String',
85
+ :'options' => :'Array<TimelineEventTemplateTokenOption>'
86
+ }
87
+ end
88
+
89
+ # List of attributes with nullable: true
90
+ def self.openapi_nullable
91
+ Set.new([
92
+ ])
93
+ end
94
+
95
+ # Initializes the object
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ def initialize(attributes = {})
98
+ if (!attributes.is_a?(Hash))
99
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Timeline::TimelineEventTemplateToken` initialize method"
100
+ end
101
+
102
+ # check to see if the attribute exists and convert string to symbol for hash key
103
+ attributes = attributes.each_with_object({}) { |(k, v), h|
104
+ if (!self.class.attribute_map.key?(k.to_sym))
105
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Timeline::TimelineEventTemplateToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
106
+ end
107
+ h[k.to_sym] = v
108
+ }
109
+
110
+ if attributes.key?(:'name')
111
+ self.name = attributes[:'name']
112
+ end
113
+
114
+ if attributes.key?(:'type')
115
+ self.type = attributes[:'type']
116
+ end
117
+
118
+ if attributes.key?(:'created_at')
119
+ self.created_at = attributes[:'created_at']
120
+ end
121
+
122
+ if attributes.key?(:'updated_at')
123
+ self.updated_at = attributes[:'updated_at']
124
+ end
125
+
126
+ if attributes.key?(:'label')
127
+ self.label = attributes[:'label']
128
+ end
129
+
130
+ if attributes.key?(:'object_property_name')
131
+ self.object_property_name = attributes[:'object_property_name']
132
+ end
133
+
134
+ if attributes.key?(:'options')
135
+ if (value = attributes[:'options']).is_a?(Array)
136
+ self.options = value
137
+ end
138
+ end
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properties with the reasons
143
+ def list_invalid_properties
144
+ invalid_properties = Array.new
145
+ if @name.nil?
146
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
147
+ end
148
+
149
+ if @type.nil?
150
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
151
+ end
152
+
153
+ if @label.nil?
154
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
155
+ end
156
+
157
+ if @options.nil?
158
+ invalid_properties.push('invalid value for "options", options cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ return false if @name.nil?
168
+ return false if @type.nil?
169
+ type_validator = EnumAttributeValidator.new('String', ["date", "enumeration", "number", "string"])
170
+ return false unless type_validator.valid?(@type)
171
+ return false if @label.nil?
172
+ return false if @options.nil?
173
+ true
174
+ end
175
+
176
+ # Custom attribute writer method checking allowed values (enum).
177
+ # @param [Object] type Object to be assigned
178
+ def type=(type)
179
+ validator = EnumAttributeValidator.new('String', ["date", "enumeration", "number", "string"])
180
+ unless validator.valid?(type)
181
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
182
+ end
183
+ @type = type
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ name == o.name &&
192
+ type == o.type &&
193
+ created_at == o.created_at &&
194
+ updated_at == o.updated_at &&
195
+ label == o.label &&
196
+ object_property_name == o.object_property_name &&
197
+ options == o.options
198
+ end
199
+
200
+ # @see the `==` method
201
+ # @param [Object] Object to be compared
202
+ def eql?(o)
203
+ self == o
204
+ end
205
+
206
+ # Calculates hash code according to all attributes.
207
+ # @return [Integer] Hash code
208
+ def hash
209
+ [name, type, created_at, updated_at, label, object_property_name, options].hash
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def self.build_from_hash(attributes)
216
+ new.build_from_hash(attributes)
217
+ end
218
+
219
+ # Builds the object from hash
220
+ # @param [Hash] attributes Model attributes in the form of hash
221
+ # @return [Object] Returns the model itself
222
+ def build_from_hash(attributes)
223
+ return nil unless attributes.is_a?(Hash)
224
+ self.class.openapi_types.each_pair do |key, type|
225
+ if type =~ /\AArray<(.*)>/i
226
+ # check to ensure the input is an array given that the attribute
227
+ # is documented as an array but the input is not
228
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
229
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
230
+ end
231
+ elsif !attributes[self.class.attribute_map[key]].nil?
232
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
233
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
234
+ end
235
+
236
+ self
237
+ end
238
+
239
+ # Deserializes the data based on type
240
+ # @param string type Data type
241
+ # @param string value Value to be deserialized
242
+ # @return [Object] Deserialized data
243
+ def _deserialize(type, value)
244
+ case type.to_sym
245
+ when :DateTime
246
+ DateTime.parse(value)
247
+ when :Date
248
+ Date.parse(value)
249
+ when :String
250
+ value.to_s
251
+ when :Integer
252
+ value.to_i
253
+ when :Float
254
+ value.to_f
255
+ when :Boolean
256
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
257
+ true
258
+ else
259
+ false
260
+ end
261
+ when :Object
262
+ # generic object (usually a Hash), return directly
263
+ value
264
+ when /\AArray<(?<inner_type>.+)>\z/
265
+ inner_type = Regexp.last_match[:inner_type]
266
+ value.map { |v| _deserialize(inner_type, v) }
267
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
268
+ k_type = Regexp.last_match[:k_type]
269
+ v_type = Regexp.last_match[:v_type]
270
+ {}.tap do |hash|
271
+ value.each do |k, v|
272
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
273
+ end
274
+ end
275
+ else # model
276
+ Hubspot::Crm::Timeline.const_get(type).build_from_hash(value)
277
+ end
278
+ end
279
+
280
+ # Returns the string representation of the object
281
+ # @return [String] String presentation of the object
282
+ def to_s
283
+ to_hash.to_s
284
+ end
285
+
286
+ # to_body is an alias to to_hash (backward compatibility)
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_body
289
+ to_hash
290
+ end
291
+
292
+ # Returns the object in the form of hash
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_hash
295
+ hash = {}
296
+ self.class.attribute_map.each_pair do |attr, param|
297
+ value = self.send(attr)
298
+ if value.nil?
299
+ is_nullable = self.class.openapi_nullable.include?(attr)
300
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
301
+ end
302
+
303
+ hash[param] = _to_hash(value)
304
+ end
305
+ hash
306
+ end
307
+
308
+ # Outputs non-array value in the form of hash
309
+ # For object, use to_hash. Otherwise, just return the value
310
+ # @param [Object] value Any valid value
311
+ # @return [Hash] Returns the value in the form of hash
312
+ def _to_hash(value)
313
+ if value.is_a?(Array)
314
+ value.compact.map { |v| _to_hash(v) }
315
+ elsif value.is_a?(Hash)
316
+ {}.tap do |hash|
317
+ value.each { |k, v| hash[k] = _to_hash(v) }
318
+ end
319
+ elsif value.respond_to? :to_hash
320
+ value.to_hash
321
+ else
322
+ value
323
+ end
324
+ end
325
+ end
326
+ end
327
+ end
328
+ end