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,294 @@
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
+ class Contains
19
+ attr_accessor :operator
20
+
21
+ attr_accessor :value
22
+
23
+ attr_accessor :inputs
24
+
25
+ attr_accessor :string_to_check
26
+
27
+ attr_accessor :property_name
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'operator' => :'operator',
55
+ :'value' => :'value',
56
+ :'inputs' => :'inputs',
57
+ :'string_to_check' => :'stringToCheck',
58
+ :'property_name' => :'propertyName'
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'operator' => :'String',
66
+ :'value' => :'Boolean',
67
+ :'inputs' => :'Array<AnyOfConstantBooleanConstantNumberConstantStringBooleanPropertyVariableStringPropertyVariableNumberPropertyVariableAddNumbersSubtractNumbersMultiplyNumbersDivideNumbersRoundDownNumbersRoundUpNumbersUpperCaseLowerCaseConcatStringsContainsBeginsWithNumberToStringParseNumberFetchExchangeRatePipelineProbabilityMaxNumbersMinNumbersLessThanLessThanOrEqualMoreThanMoreThanOrEqualNumberEqualsStringEqualsNotDateMonthYearNowTimeBetweenPeriodToMonthsAndOrXorIfStringIfNumberIfBooleanIsPresentHasEmailReplyHasPlainTextEmailReplyExtractMostRecentEmailReplyHtmlExtractMostRecentEmailReplyTextExtractMostRecentPlainTextEmailReply>',
68
+ :'string_to_check' => :'OneOfConstantBooleanConstantNumberConstantStringBooleanPropertyVariableStringPropertyVariableNumberPropertyVariableAddNumbersSubtractNumbersMultiplyNumbersDivideNumbersRoundDownNumbersRoundUpNumbersUpperCaseLowerCaseConcatStringsContainsBeginsWithNumberToStringParseNumberFetchExchangeRatePipelineProbabilityMaxNumbersMinNumbersLessThanLessThanOrEqualMoreThanMoreThanOrEqualNumberEqualsStringEqualsNotDateMonthYearNowTimeBetweenPeriodToMonthsAndOrXorIfStringIfNumberIfBooleanIsPresentHasEmailReplyHasPlainTextEmailReplyExtractMostRecentEmailReplyHtmlExtractMostRecentEmailReplyTextExtractMostRecentPlainTextEmailReply',
69
+ :'property_name' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Timeline::Contains` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Timeline::Contains`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'operator')
95
+ self.operator = attributes[:'operator']
96
+ else
97
+ self.operator = 'CONTAINS'
98
+ end
99
+
100
+ if attributes.key?(:'value')
101
+ self.value = attributes[:'value']
102
+ end
103
+
104
+ if attributes.key?(:'inputs')
105
+ if (value = attributes[:'inputs']).is_a?(Array)
106
+ self.inputs = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'string_to_check')
111
+ self.string_to_check = attributes[:'string_to_check']
112
+ end
113
+
114
+ if attributes.key?(:'property_name')
115
+ self.property_name = attributes[:'property_name']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ if @operator.nil?
124
+ invalid_properties.push('invalid value for "operator", operator cannot be nil.')
125
+ end
126
+
127
+ if @string_to_check.nil?
128
+ invalid_properties.push('invalid value for "string_to_check", string_to_check cannot be nil.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ return false if @operator.nil?
138
+ operator_validator = EnumAttributeValidator.new('String', ["CONTAINS"])
139
+ return false unless operator_validator.valid?(@operator)
140
+ return false if @string_to_check.nil?
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] operator Object to be assigned
146
+ def operator=(operator)
147
+ validator = EnumAttributeValidator.new('String', ["CONTAINS"])
148
+ unless validator.valid?(operator)
149
+ fail ArgumentError, "invalid value for \"operator\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @operator = operator
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ operator == o.operator &&
160
+ value == o.value &&
161
+ inputs == o.inputs &&
162
+ string_to_check == o.string_to_check &&
163
+ property_name == o.property_name
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [operator, value, inputs, string_to_check, property_name].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ new.build_from_hash(attributes)
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ self.class.openapi_types.each_pair do |key, type|
191
+ if type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ end
197
+ elsif !attributes[self.class.attribute_map[key]].nil?
198
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
200
+ end
201
+
202
+ self
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def _deserialize(type, value)
210
+ case type.to_sym
211
+ when :DateTime
212
+ DateTime.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ Hubspot::Crm::Timeline.const_get(type).build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+ end
292
+ end
293
+ end
294
+ end
@@ -0,0 +1,280 @@
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
+ class Date
19
+ attr_accessor :operator
20
+
21
+ attr_accessor :value
22
+
23
+ attr_accessor :inputs
24
+
25
+ attr_accessor :property_name
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'operator' => :'operator',
53
+ :'value' => :'value',
54
+ :'inputs' => :'inputs',
55
+ :'property_name' => :'propertyName'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'operator' => :'String',
63
+ :'value' => :'Float',
64
+ :'inputs' => :'Array<AnyOfConstantBooleanConstantNumberConstantStringBooleanPropertyVariableStringPropertyVariableNumberPropertyVariableAddNumbersSubtractNumbersMultiplyNumbersDivideNumbersRoundDownNumbersRoundUpNumbersUpperCaseLowerCaseConcatStringsContainsBeginsWithNumberToStringParseNumberFetchExchangeRatePipelineProbabilityMaxNumbersMinNumbersLessThanLessThanOrEqualMoreThanMoreThanOrEqualNumberEqualsStringEqualsNotDateMonthYearNowTimeBetweenPeriodToMonthsAndOrXorIfStringIfNumberIfBooleanIsPresentHasEmailReplyHasPlainTextEmailReplyExtractMostRecentEmailReplyHtmlExtractMostRecentEmailReplyTextExtractMostRecentPlainTextEmailReply>',
65
+ :'property_name' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Timeline::Date` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Timeline::Date`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'operator')
91
+ self.operator = attributes[:'operator']
92
+ else
93
+ self.operator = 'DATE'
94
+ end
95
+
96
+ if attributes.key?(:'value')
97
+ self.value = attributes[:'value']
98
+ end
99
+
100
+ if attributes.key?(:'inputs')
101
+ if (value = attributes[:'inputs']).is_a?(Array)
102
+ self.inputs = value
103
+ end
104
+ end
105
+
106
+ if attributes.key?(:'property_name')
107
+ self.property_name = attributes[:'property_name']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+ if @operator.nil?
116
+ invalid_properties.push('invalid value for "operator", operator cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ return false if @operator.nil?
126
+ operator_validator = EnumAttributeValidator.new('String', ["DATE"])
127
+ return false unless operator_validator.valid?(@operator)
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method checking allowed values (enum).
132
+ # @param [Object] operator Object to be assigned
133
+ def operator=(operator)
134
+ validator = EnumAttributeValidator.new('String', ["DATE"])
135
+ unless validator.valid?(operator)
136
+ fail ArgumentError, "invalid value for \"operator\", must be one of #{validator.allowable_values}."
137
+ end
138
+ @operator = operator
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ operator == o.operator &&
147
+ value == o.value &&
148
+ inputs == o.inputs &&
149
+ property_name == o.property_name
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ def hash
161
+ [operator, value, inputs, property_name].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def self.build_from_hash(attributes)
168
+ new.build_from_hash(attributes)
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ self.class.openapi_types.each_pair do |key, type|
177
+ if type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :DateTime
198
+ DateTime.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ Hubspot::Crm::Timeline.const_get(type).build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+ end
278
+ end
279
+ end
280
+ end