hubspot-api-client 9.3.0 → 9.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/Gemfile.lock +3 -1
  4. data/hubspot-api-client.gemspec +1 -0
  5. data/lib/hubspot-api-client.rb +5 -664
  6. data/lib/hubspot/codegen/crm/extensions/accounting/api/callbacks_api.rb +728 -0
  7. data/lib/hubspot/codegen/crm/extensions/accounting/api/invoice_api.rb +247 -0
  8. data/lib/hubspot/codegen/crm/extensions/accounting/api/settings_api.rb +160 -0
  9. data/lib/hubspot/codegen/crm/extensions/accounting/api/sync_api.rb +168 -0
  10. data/lib/hubspot/codegen/crm/extensions/accounting/api/user_accounts_api.rb +154 -0
  11. data/lib/hubspot/codegen/crm/extensions/accounting/api_client.rb +394 -0
  12. data/lib/hubspot/codegen/crm/extensions/accounting/api_error.rb +63 -0
  13. data/lib/hubspot/codegen/crm/extensions/accounting/configuration.rb +265 -0
  14. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_app_settings.rb +241 -0
  15. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_app_urls.rb +381 -0
  16. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_customer.rb +262 -0
  17. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_invoice.rb +357 -0
  18. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_extension_term.rb +253 -0
  19. data/lib/hubspot/codegen/crm/extensions/accounting/models/accounting_features.rb +248 -0
  20. data/lib/hubspot/codegen/crm/extensions/accounting/models/action_response.rb +299 -0
  21. data/lib/hubspot/codegen/crm/extensions/accounting/models/address.rb +253 -0
  22. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_invoice_feature.rb +232 -0
  23. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_invoice_sub_features.rb +293 -0
  24. data/lib/hubspot/codegen/crm/extensions/accounting/models/create_user_account_request_external.rb +248 -0
  25. data/lib/hubspot/codegen/crm/extensions/accounting/models/customer_search_response_external.rb +269 -0
  26. data/lib/hubspot/codegen/crm/extensions/accounting/models/error.rb +294 -0
  27. data/lib/hubspot/codegen/crm/extensions/accounting/models/error_detail.rb +260 -0
  28. data/lib/hubspot/codegen/crm/extensions/accounting/models/exchange_rate_response.rb +297 -0
  29. data/lib/hubspot/codegen/crm/extensions/accounting/models/import_invoice_feature.rb +218 -0
  30. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_create_payment_request.rb +263 -0
  31. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_pdf_response.rb +283 -0
  32. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_read_response.rb +455 -0
  33. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_search_response.rb +264 -0
  34. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_update_request.rb +281 -0
  35. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoice_update_response.rb +441 -0
  36. data/lib/hubspot/codegen/crm/extensions/accounting/models/invoices_response_external.rb +264 -0
  37. data/lib/hubspot/codegen/crm/extensions/accounting/models/object_sync_feature.rb +218 -0
  38. data/lib/hubspot/codegen/crm/extensions/accounting/models/product.rb +281 -0
  39. data/lib/hubspot/codegen/crm/extensions/accounting/models/product_search_response.rb +264 -0
  40. data/lib/hubspot/codegen/crm/extensions/accounting/models/result_id_accounting_response.rb +267 -0
  41. data/lib/hubspot/codegen/crm/extensions/accounting/models/sync_contacts_request.rb +235 -0
  42. data/lib/hubspot/codegen/crm/extensions/accounting/models/sync_products_request.rb +235 -0
  43. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax.rb +248 -0
  44. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax_search_response.rb +264 -0
  45. data/lib/hubspot/codegen/crm/extensions/accounting/models/tax_type.rb +228 -0
  46. data/lib/hubspot/codegen/crm/extensions/accounting/models/terms_response.rb +264 -0
  47. data/lib/hubspot/codegen/crm/extensions/accounting/models/unit_price.rb +228 -0
  48. data/lib/hubspot/codegen/crm/extensions/accounting/models/updated_contact.rb +319 -0
  49. data/lib/hubspot/codegen/crm/extensions/accounting/models/updated_product.rb +324 -0
  50. data/lib/hubspot/codegen/crm/extensions/calling/api/settings_api.rb +284 -0
  51. data/lib/hubspot/codegen/crm/extensions/calling/api_client.rb +394 -0
  52. data/lib/hubspot/codegen/crm/extensions/calling/api_error.rb +63 -0
  53. data/lib/hubspot/codegen/crm/extensions/calling/configuration.rb +258 -0
  54. data/lib/hubspot/codegen/crm/extensions/calling/models/error.rb +294 -0
  55. data/lib/hubspot/codegen/crm/extensions/calling/models/error_detail.rb +260 -0
  56. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_patch_request.rb +253 -0
  57. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_request.rb +263 -0
  58. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_response.rb +308 -0
  59. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api/settings_api.rb +222 -0
  60. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_client.rb +394 -0
  61. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_error.rb +63 -0
  62. data/lib/hubspot/codegen/crm/extensions/videoconferencing/configuration.rb +258 -0
  63. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/error.rb +294 -0
  64. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/error_detail.rb +260 -0
  65. data/lib/hubspot/codegen/crm/extensions/videoconferencing/models/external_settings.rb +248 -0
  66. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +103 -0
  67. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +181 -0
  68. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +95 -0
  69. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +92 -0
  70. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_client.rb +394 -0
  71. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_error.rb +63 -0
  72. data/lib/hubspot/codegen/crm/objects/feedback_submissions/configuration.rb +258 -0
  73. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/associated_id.rb +231 -0
  74. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input.rb +219 -0
  75. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id.rb +219 -0
  76. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input.rb +219 -0
  77. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.rb +244 -0
  78. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object.rb +315 -0
  79. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object_with_errors.rb +335 -0
  80. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id.rb +228 -0
  81. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_simple_public_object.rb +228 -0
  82. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_with_total_simple_public_object.rb +243 -0
  83. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/error.rb +294 -0
  84. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/error_category.rb +265 -0
  85. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/error_detail.rb +260 -0
  86. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/filter.rb +274 -0
  87. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/filter_group.rb +219 -0
  88. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/next_page.rb +226 -0
  89. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/paging.rb +221 -0
  90. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/previous_page.rb +226 -0
  91. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/public_object_search_request.rb +288 -0
  92. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object.rb +290 -0
  93. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_batch_input.rb +233 -0
  94. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_id.rb +217 -0
  95. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_input.rb +219 -0
  96. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/standard_error.rb +311 -0
  97. data/lib/hubspot/codegen/files/files/api/files_api.rb +787 -0
  98. data/lib/hubspot/codegen/files/files/api/folders_api.rb +579 -0
  99. data/lib/hubspot/codegen/files/files/api_client.rb +392 -0
  100. data/lib/hubspot/codegen/files/files/api_error.rb +61 -0
  101. data/lib/hubspot/codegen/files/files/configuration.rb +263 -0
  102. data/lib/hubspot/codegen/files/files/models/collection_response_file.rb +226 -0
  103. data/lib/hubspot/codegen/files/files/models/collection_response_folder.rb +226 -0
  104. data/lib/hubspot/codegen/files/files/models/error.rb +292 -0
  105. data/lib/hubspot/codegen/files/files/models/error_category.rb +263 -0
  106. data/lib/hubspot/codegen/files/files/models/error_detail.rb +258 -0
  107. data/lib/hubspot/codegen/files/files/models/file.rb +440 -0
  108. data/lib/hubspot/codegen/files/files/models/file_action_response.rb +348 -0
  109. data/lib/hubspot/codegen/files/files/models/file_update_input.rb +285 -0
  110. data/lib/hubspot/codegen/files/files/models/folder.rb +301 -0
  111. data/lib/hubspot/codegen/files/files/models/folder_action_response.rb +348 -0
  112. data/lib/hubspot/codegen/files/files/models/folder_input.rb +236 -0
  113. data/lib/hubspot/codegen/files/files/models/folder_update_input.rb +236 -0
  114. data/lib/hubspot/codegen/files/files/models/folder_update_task_locator.rb +228 -0
  115. data/lib/hubspot/codegen/files/files/models/import_from_url_input.rb +374 -0
  116. data/lib/hubspot/codegen/files/files/models/import_from_url_task_locator.rb +228 -0
  117. data/lib/hubspot/codegen/files/files/models/next_page.rb +224 -0
  118. data/lib/hubspot/codegen/files/files/models/paging.rb +219 -0
  119. data/lib/hubspot/codegen/files/files/models/previous_page.rb +224 -0
  120. data/lib/hubspot/codegen/files/files/models/signed_url.rb +311 -0
  121. data/lib/hubspot/codegen/files/files/models/standard_error.rb +309 -0
  122. data/lib/hubspot/codegen/marketing/transactional/api/default_api.rb +400 -0
  123. data/lib/hubspot/codegen/marketing/transactional/api_client.rb +392 -0
  124. data/lib/hubspot/codegen/marketing/transactional/api_error.rb +61 -0
  125. data/lib/hubspot/codegen/marketing/transactional/configuration.rb +263 -0
  126. data/lib/hubspot/codegen/marketing/transactional/models/collection_response_smtp_api_token_view.rb +227 -0
  127. data/lib/hubspot/codegen/marketing/transactional/models/email_send_status_view.rb +326 -0
  128. data/lib/hubspot/codegen/marketing/transactional/models/error.rb +292 -0
  129. data/lib/hubspot/codegen/marketing/transactional/models/error_detail.rb +258 -0
  130. data/lib/hubspot/codegen/marketing/transactional/models/event_id_view.rb +231 -0
  131. data/lib/hubspot/codegen/marketing/transactional/models/next_page.rb +224 -0
  132. data/lib/hubspot/codegen/marketing/transactional/models/paging.rb +210 -0
  133. data/lib/hubspot/codegen/marketing/transactional/models/public_single_send_email.rb +282 -0
  134. data/lib/hubspot/codegen/marketing/transactional/models/public_single_send_request_egg.rb +262 -0
  135. data/lib/hubspot/codegen/marketing/transactional/models/smtp_api_token_request_egg.rb +231 -0
  136. data/lib/hubspot/codegen/marketing/transactional/models/smtp_api_token_view.rb +301 -0
  137. data/lib/hubspot/version.rb +1 -1
  138. data/spec/codegen/crm/extensions/accounting/api/callbacks_api_spec.rb +165 -0
  139. data/spec/codegen/crm/extensions/accounting/api/invoice_api_spec.rb +76 -0
  140. data/spec/codegen/crm/extensions/accounting/api/settings_api_spec.rb +60 -0
  141. data/spec/codegen/crm/extensions/accounting/api/sync_api_spec.rb +61 -0
  142. data/spec/codegen/crm/extensions/accounting/api/user_accounts_api_spec.rb +59 -0
  143. data/spec/codegen/crm/extensions/accounting/models/accounting_app_settings_spec.rb +53 -0
  144. data/spec/codegen/crm/extensions/accounting/models/accounting_app_urls_spec.rb +125 -0
  145. data/spec/codegen/crm/extensions/accounting/models/accounting_extension_customer_spec.rb +65 -0
  146. data/spec/codegen/crm/extensions/accounting/models/accounting_extension_invoice_spec.rb +93 -0
  147. data/spec/codegen/crm/extensions/accounting/models/accounting_extension_term_spec.rb +59 -0
  148. data/spec/codegen/crm/extensions/accounting/models/accounting_features_spec.rb +53 -0
  149. data/spec/codegen/crm/extensions/accounting/models/action_response_spec.rb +69 -0
  150. data/spec/codegen/crm/extensions/accounting/models/address_spec.rb +65 -0
  151. data/spec/codegen/crm/extensions/accounting/models/create_invoice_feature_spec.rb +47 -0
  152. data/spec/codegen/crm/extensions/accounting/models/create_invoice_sub_features_spec.rb +71 -0
  153. data/spec/codegen/crm/extensions/accounting/models/create_user_account_request_external_spec.rb +53 -0
  154. data/spec/codegen/crm/extensions/accounting/models/customer_search_response_external_spec.rb +51 -0
  155. data/spec/codegen/crm/extensions/accounting/models/error_detail_spec.rb +65 -0
  156. data/spec/codegen/crm/extensions/accounting/models/error_spec.rb +77 -0
  157. data/spec/codegen/crm/extensions/accounting/models/exchange_rate_response_spec.rb +63 -0
  158. data/spec/codegen/crm/extensions/accounting/models/import_invoice_feature_spec.rb +41 -0
  159. data/spec/codegen/crm/extensions/accounting/models/invoice_create_payment_request_spec.rb +59 -0
  160. data/spec/codegen/crm/extensions/accounting/models/invoice_pdf_response_spec.rb +51 -0
  161. data/spec/codegen/crm/extensions/accounting/models/invoice_read_response_spec.rb +135 -0
  162. data/spec/codegen/crm/extensions/accounting/models/invoice_search_response_spec.rb +51 -0
  163. data/spec/codegen/crm/extensions/accounting/models/invoice_update_request_spec.rb +83 -0
  164. data/spec/codegen/crm/extensions/accounting/models/invoice_update_response_spec.rb +135 -0
  165. data/spec/codegen/crm/extensions/accounting/models/invoices_response_external_spec.rb +51 -0
  166. data/spec/codegen/crm/extensions/accounting/models/object_sync_feature_spec.rb +41 -0
  167. data/spec/codegen/crm/extensions/accounting/models/product_search_response_spec.rb +51 -0
  168. data/spec/codegen/crm/extensions/accounting/models/product_spec.rb +71 -0
  169. data/spec/codegen/crm/extensions/accounting/models/result_id_accounting_response_spec.rb +51 -0
  170. data/spec/codegen/crm/extensions/accounting/models/sync_contacts_request_spec.rb +47 -0
  171. data/spec/codegen/crm/extensions/accounting/models/sync_products_request_spec.rb +47 -0
  172. data/spec/codegen/crm/extensions/accounting/models/tax_search_response_spec.rb +51 -0
  173. data/spec/codegen/crm/extensions/accounting/models/tax_spec.rb +53 -0
  174. data/spec/codegen/crm/extensions/accounting/models/tax_type_spec.rb +47 -0
  175. data/spec/codegen/crm/extensions/accounting/models/terms_response_spec.rb +51 -0
  176. data/spec/codegen/crm/extensions/accounting/models/unit_price_spec.rb +47 -0
  177. data/spec/codegen/crm/extensions/accounting/models/updated_contact_spec.rb +73 -0
  178. data/spec/codegen/crm/extensions/accounting/models/updated_product_spec.rb +75 -0
  179. data/spec/codegen/crm/extensions/calling/api/settings_api_spec.rb +85 -0
  180. data/spec/codegen/crm/extensions/calling/models/error_detail_spec.rb +65 -0
  181. data/spec/codegen/crm/extensions/calling/models/error_spec.rb +77 -0
  182. data/spec/codegen/crm/extensions/calling/models/settings_patch_request_spec.rb +65 -0
  183. data/spec/codegen/crm/extensions/calling/models/settings_request_spec.rb +65 -0
  184. data/spec/codegen/crm/extensions/calling/models/settings_response_spec.rb +77 -0
  185. data/spec/codegen/crm/extensions/videoconferencing/api/settings_api_spec.rb +72 -0
  186. data/spec/codegen/crm/extensions/videoconferencing/models/error_detail_spec.rb +65 -0
  187. data/spec/codegen/crm/extensions/videoconferencing/models/error_spec.rb +77 -0
  188. data/spec/codegen/crm/extensions/videoconferencing/models/external_settings_spec.rb +59 -0
  189. data/spec/codegen/crm/objects/feedback_submissions/api/associations_api_spec.rb +50 -0
  190. data/spec/codegen/crm/objects/feedback_submissions/api/basic_api_spec.rb +69 -0
  191. data/spec/codegen/crm/objects/feedback_submissions/api/batch_api_spec.rb +48 -0
  192. data/spec/codegen/crm/objects/feedback_submissions/api/search_api_spec.rb +47 -0
  193. data/spec/codegen/crm/objects/feedback_submissions/models/associated_id_spec.rb +47 -0
  194. data/spec/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_batch_input_spec.rb +41 -0
  195. data/spec/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_id_spec.rb +41 -0
  196. data/spec/codegen/crm/objects/feedback_submissions/models/batch_input_simple_public_object_input_spec.rb +41 -0
  197. data/spec/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id_spec.rb +53 -0
  198. data/spec/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object_spec.rb +75 -0
  199. data/spec/codegen/crm/objects/feedback_submissions/models/batch_response_simple_public_object_with_errors_spec.rb +87 -0
  200. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id_spec.rb +47 -0
  201. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_simple_public_object_spec.rb +47 -0
  202. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_with_total_simple_public_object_spec.rb +53 -0
  203. data/spec/codegen/crm/objects/feedback_submissions/models/error_category_spec.rb +51 -0
  204. data/spec/codegen/crm/objects/feedback_submissions/models/error_detail_spec.rb +65 -0
  205. data/spec/codegen/crm/objects/feedback_submissions/models/error_spec.rb +77 -0
  206. data/spec/codegen/crm/objects/feedback_submissions/models/filter_group_spec.rb +41 -0
  207. data/spec/codegen/crm/objects/feedback_submissions/models/filter_spec.rb +57 -0
  208. data/spec/codegen/crm/objects/feedback_submissions/models/next_page_spec.rb +47 -0
  209. data/spec/codegen/crm/objects/feedback_submissions/models/paging_spec.rb +47 -0
  210. data/spec/codegen/crm/objects/feedback_submissions/models/previous_page_spec.rb +47 -0
  211. data/spec/codegen/crm/objects/feedback_submissions/models/public_object_search_request_spec.rb +71 -0
  212. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_batch_input_spec.rb +47 -0
  213. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_id_spec.rb +41 -0
  214. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_input_spec.rb +41 -0
  215. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_spec.rb +77 -0
  216. data/spec/codegen/crm/objects/feedback_submissions/models/standard_error_spec.rb +83 -0
  217. data/spec/codegen/files/files/api/files_api_spec.rb +189 -0
  218. data/spec/codegen/files/files/api/folders_api_spec.rb +143 -0
  219. data/spec/codegen/files/files/models/collection_response_file_spec.rb +47 -0
  220. data/spec/codegen/files/files/models/collection_response_folder_spec.rb +47 -0
  221. data/spec/codegen/files/files/models/error_category_spec.rb +51 -0
  222. data/spec/codegen/files/files/models/error_detail_spec.rb +65 -0
  223. data/spec/codegen/files/files/models/error_spec.rb +77 -0
  224. data/spec/codegen/files/files/models/file_action_response_spec.rb +93 -0
  225. data/spec/codegen/files/files/models/file_spec.rb +147 -0
  226. data/spec/codegen/files/files/models/file_update_input_spec.rb +69 -0
  227. data/spec/codegen/files/files/models/folder_action_response_spec.rb +93 -0
  228. data/spec/codegen/files/files/models/folder_input_spec.rb +53 -0
  229. data/spec/codegen/files/files/models/folder_spec.rb +83 -0
  230. data/spec/codegen/files/files/models/folder_update_input_spec.rb +53 -0
  231. data/spec/codegen/files/files/models/folder_update_task_locator_spec.rb +47 -0
  232. data/spec/codegen/files/files/models/import_from_url_input_spec.rb +101 -0
  233. data/spec/codegen/files/files/models/import_from_url_task_locator_spec.rb +47 -0
  234. data/spec/codegen/files/files/models/next_page_spec.rb +47 -0
  235. data/spec/codegen/files/files/models/paging_spec.rb +47 -0
  236. data/spec/codegen/files/files/models/previous_page_spec.rb +47 -0
  237. data/spec/codegen/files/files/models/signed_url_spec.rb +83 -0
  238. data/spec/codegen/files/files/models/standard_error_spec.rb +83 -0
  239. data/spec/codegen/marketing/transactional/api/default_api_spec.rb +110 -0
  240. data/spec/codegen/marketing/transactional/models/collection_response_smtp_api_token_view_spec.rb +47 -0
  241. data/spec/codegen/marketing/transactional/models/email_send_status_view_spec.rb +85 -0
  242. data/spec/codegen/marketing/transactional/models/error_detail_spec.rb +65 -0
  243. data/spec/codegen/marketing/transactional/models/error_spec.rb +77 -0
  244. data/spec/codegen/marketing/transactional/models/event_id_view_spec.rb +47 -0
  245. data/spec/codegen/marketing/transactional/models/next_page_spec.rb +47 -0
  246. data/spec/codegen/marketing/transactional/models/paging_spec.rb +41 -0
  247. data/spec/codegen/marketing/transactional/models/public_single_send_email_spec.rb +71 -0
  248. data/spec/codegen/marketing/transactional/models/public_single_send_request_egg_spec.rb +59 -0
  249. data/spec/codegen/marketing/transactional/models/smtp_api_token_request_egg_spec.rb +47 -0
  250. data/spec/codegen/marketing/transactional/models/smtp_api_token_view_spec.rb +77 -0
  251. data/spec/features/crm/extensions/accounting/callbacks_api_spec.rb +16 -0
  252. data/spec/features/crm/extensions/accounting/invoice_api_spec.rb +9 -0
  253. data/spec/features/crm/extensions/accounting/settings_api_spec.rb +8 -0
  254. data/spec/features/crm/extensions/accounting/sync_api_spec.rb +8 -0
  255. data/spec/features/crm/extensions/accounting/user_accounts_api_spec.rb +8 -0
  256. data/spec/features/crm/extensions/calling/settings_api_spec.rb +10 -0
  257. data/spec/features/crm/extensions/videoconferencing/settings_api_spec.rb +9 -0
  258. data/spec/features/crm/objects/feedback_submissions/associations_api_spec.rb +7 -0
  259. data/spec/features/crm/objects/feedback_submissions/basic_api_spec.rb +8 -0
  260. data/spec/features/crm/objects/feedback_submissions/batch_api_spec.rb +7 -0
  261. data/spec/features/crm/objects/feedback_submissions/search_api_spec.rb +7 -0
  262. data/spec/features/files/files/files_api_spec.rb +16 -0
  263. data/spec/features/files/files/folders_api_spec.rb +14 -0
  264. data/spec/features/marketing/transactional/default_api_spec.rb +12 -0
  265. metadata +401 -2
@@ -0,0 +1,440 @@
1
+ =begin
2
+ #Files
3
+
4
+ #Upload and manage files.
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Hubspot
16
+ module Files
17
+ module Files
18
+ class File
19
+ # File ID.
20
+ attr_accessor :id
21
+
22
+ # Creation time of the file object.
23
+ attr_accessor :created_at
24
+
25
+ # Deletion time of the file object.
26
+ attr_accessor :archived_at
27
+
28
+ # Timestamp of the latest update to the file.
29
+ attr_accessor :updated_at
30
+
31
+ # If the file is deleted.
32
+ attr_accessor :archived
33
+
34
+ # Id of the folder the file is in.
35
+ attr_accessor :parent_folder_id
36
+
37
+ # Name of the file.
38
+ attr_accessor :name
39
+
40
+ # Path of the file in the file manager.
41
+ attr_accessor :path
42
+
43
+ # Size in bytes of the file.
44
+ attr_accessor :size
45
+
46
+ # For image and video files, the height of the content.
47
+ attr_accessor :height
48
+
49
+ # For image and video files, the width of the content.
50
+ attr_accessor :width
51
+
52
+ # Encoding of the file.
53
+ attr_accessor :encoding
54
+
55
+ # Type of the file. Can be IMG, DOCUMENT, AUDIO, MOVIE, or OTHER.
56
+ attr_accessor :type
57
+
58
+ # Extension of the file. For example png.
59
+ attr_accessor :extension
60
+
61
+ # Default hosting URL of the file. This will use one of HubSpot's provided URLs to serve the file.
62
+ attr_accessor :default_hosting_url
63
+
64
+ # URL of the given file. This URL can change depending on the domain settings of the account. Will use the select file hosting domain.
65
+ attr_accessor :url
66
+
67
+ # Previously \"archied\". Indicates if the file should be used when creating new content like web pages.
68
+ attr_accessor :is_usable_in_content
69
+
70
+ # File access. Can be PUBLIC_INDEXABLE, PUBLIC_NOT_INDEXABLE, PRIVATE.
71
+ attr_accessor :access
72
+
73
+ class EnumAttributeValidator
74
+ attr_reader :datatype
75
+ attr_reader :allowable_values
76
+
77
+ def initialize(datatype, allowable_values)
78
+ @allowable_values = allowable_values.map do |value|
79
+ case datatype.to_s
80
+ when /Integer/i
81
+ value.to_i
82
+ when /Float/i
83
+ value.to_f
84
+ else
85
+ value
86
+ end
87
+ end
88
+ end
89
+
90
+ def valid?(value)
91
+ !value || allowable_values.include?(value)
92
+ end
93
+ end
94
+
95
+ # Attribute mapping from ruby-style variable name to JSON key.
96
+ def self.attribute_map
97
+ {
98
+ :'id' => :'id',
99
+ :'created_at' => :'createdAt',
100
+ :'archived_at' => :'archivedAt',
101
+ :'updated_at' => :'updatedAt',
102
+ :'archived' => :'archived',
103
+ :'parent_folder_id' => :'parentFolderId',
104
+ :'name' => :'name',
105
+ :'path' => :'path',
106
+ :'size' => :'size',
107
+ :'height' => :'height',
108
+ :'width' => :'width',
109
+ :'encoding' => :'encoding',
110
+ :'type' => :'type',
111
+ :'extension' => :'extension',
112
+ :'default_hosting_url' => :'defaultHostingUrl',
113
+ :'url' => :'url',
114
+ :'is_usable_in_content' => :'isUsableInContent',
115
+ :'access' => :'access'
116
+ }
117
+ end
118
+
119
+ # Attribute type mapping.
120
+ def self.openapi_types
121
+ {
122
+ :'id' => :'String',
123
+ :'created_at' => :'DateTime',
124
+ :'archived_at' => :'DateTime',
125
+ :'updated_at' => :'DateTime',
126
+ :'archived' => :'Boolean',
127
+ :'parent_folder_id' => :'String',
128
+ :'name' => :'String',
129
+ :'path' => :'String',
130
+ :'size' => :'Integer',
131
+ :'height' => :'Integer',
132
+ :'width' => :'Integer',
133
+ :'encoding' => :'String',
134
+ :'type' => :'String',
135
+ :'extension' => :'String',
136
+ :'default_hosting_url' => :'String',
137
+ :'url' => :'String',
138
+ :'is_usable_in_content' => :'Boolean',
139
+ :'access' => :'String'
140
+ }
141
+ end
142
+
143
+ # List of attributes with nullable: true
144
+ def self.openapi_nullable
145
+ Set.new([
146
+ ])
147
+ end
148
+
149
+ # Initializes the object
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ def initialize(attributes = {})
152
+ if (!attributes.is_a?(Hash))
153
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Files::Files::File` initialize method"
154
+ end
155
+
156
+ # check to see if the attribute exists and convert string to symbol for hash key
157
+ attributes = attributes.each_with_object({}) { |(k, v), h|
158
+ if (!self.class.attribute_map.key?(k.to_sym))
159
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Files::Files::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
160
+ end
161
+ h[k.to_sym] = v
162
+ }
163
+
164
+ if attributes.key?(:'id')
165
+ self.id = attributes[:'id']
166
+ end
167
+
168
+ if attributes.key?(:'created_at')
169
+ self.created_at = attributes[:'created_at']
170
+ end
171
+
172
+ if attributes.key?(:'archived_at')
173
+ self.archived_at = attributes[:'archived_at']
174
+ end
175
+
176
+ if attributes.key?(:'updated_at')
177
+ self.updated_at = attributes[:'updated_at']
178
+ end
179
+
180
+ if attributes.key?(:'archived')
181
+ self.archived = attributes[:'archived']
182
+ end
183
+
184
+ if attributes.key?(:'parent_folder_id')
185
+ self.parent_folder_id = attributes[:'parent_folder_id']
186
+ end
187
+
188
+ if attributes.key?(:'name')
189
+ self.name = attributes[:'name']
190
+ end
191
+
192
+ if attributes.key?(:'path')
193
+ self.path = attributes[:'path']
194
+ end
195
+
196
+ if attributes.key?(:'size')
197
+ self.size = attributes[:'size']
198
+ end
199
+
200
+ if attributes.key?(:'height')
201
+ self.height = attributes[:'height']
202
+ end
203
+
204
+ if attributes.key?(:'width')
205
+ self.width = attributes[:'width']
206
+ end
207
+
208
+ if attributes.key?(:'encoding')
209
+ self.encoding = attributes[:'encoding']
210
+ end
211
+
212
+ if attributes.key?(:'type')
213
+ self.type = attributes[:'type']
214
+ end
215
+
216
+ if attributes.key?(:'extension')
217
+ self.extension = attributes[:'extension']
218
+ end
219
+
220
+ if attributes.key?(:'default_hosting_url')
221
+ self.default_hosting_url = attributes[:'default_hosting_url']
222
+ end
223
+
224
+ if attributes.key?(:'url')
225
+ self.url = attributes[:'url']
226
+ end
227
+
228
+ if attributes.key?(:'is_usable_in_content')
229
+ self.is_usable_in_content = attributes[:'is_usable_in_content']
230
+ end
231
+
232
+ if attributes.key?(:'access')
233
+ self.access = attributes[:'access']
234
+ end
235
+ end
236
+
237
+ # Show invalid properties with the reasons. Usually used together with valid?
238
+ # @return Array for valid properties with the reasons
239
+ def list_invalid_properties
240
+ invalid_properties = Array.new
241
+ if @id.nil?
242
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
243
+ end
244
+
245
+ if @created_at.nil?
246
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
247
+ end
248
+
249
+ if @updated_at.nil?
250
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
251
+ end
252
+
253
+ if @archived.nil?
254
+ invalid_properties.push('invalid value for "archived", archived cannot be nil.')
255
+ end
256
+
257
+ if @access.nil?
258
+ invalid_properties.push('invalid value for "access", access cannot be nil.')
259
+ end
260
+
261
+ invalid_properties
262
+ end
263
+
264
+ # Check to see if the all the properties in the model are valid
265
+ # @return true if the model is valid
266
+ def valid?
267
+ return false if @id.nil?
268
+ return false if @created_at.nil?
269
+ return false if @updated_at.nil?
270
+ return false if @archived.nil?
271
+ return false if @access.nil?
272
+ access_validator = EnumAttributeValidator.new('String', ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "PRIVATE"])
273
+ return false unless access_validator.valid?(@access)
274
+ true
275
+ end
276
+
277
+ # Custom attribute writer method checking allowed values (enum).
278
+ # @param [Object] access Object to be assigned
279
+ def access=(access)
280
+ validator = EnumAttributeValidator.new('String', ["PUBLIC_INDEXABLE", "PUBLIC_NOT_INDEXABLE", "PRIVATE"])
281
+ unless validator.valid?(access)
282
+ fail ArgumentError, "invalid value for \"access\", must be one of #{validator.allowable_values}."
283
+ end
284
+ @access = access
285
+ end
286
+
287
+ # Checks equality by comparing each attribute.
288
+ # @param [Object] Object to be compared
289
+ def ==(o)
290
+ return true if self.equal?(o)
291
+ self.class == o.class &&
292
+ id == o.id &&
293
+ created_at == o.created_at &&
294
+ archived_at == o.archived_at &&
295
+ updated_at == o.updated_at &&
296
+ archived == o.archived &&
297
+ parent_folder_id == o.parent_folder_id &&
298
+ name == o.name &&
299
+ path == o.path &&
300
+ size == o.size &&
301
+ height == o.height &&
302
+ width == o.width &&
303
+ encoding == o.encoding &&
304
+ type == o.type &&
305
+ extension == o.extension &&
306
+ default_hosting_url == o.default_hosting_url &&
307
+ url == o.url &&
308
+ is_usable_in_content == o.is_usable_in_content &&
309
+ access == o.access
310
+ end
311
+
312
+ # @see the `==` method
313
+ # @param [Object] Object to be compared
314
+ def eql?(o)
315
+ self == o
316
+ end
317
+
318
+ # Calculates hash code according to all attributes.
319
+ # @return [Integer] Hash code
320
+ def hash
321
+ [id, created_at, archived_at, updated_at, archived, parent_folder_id, name, path, size, height, width, encoding, type, extension, default_hosting_url, url, is_usable_in_content, access].hash
322
+ end
323
+
324
+ # Builds the object from hash
325
+ # @param [Hash] attributes Model attributes in the form of hash
326
+ # @return [Object] Returns the model itself
327
+ def self.build_from_hash(attributes)
328
+ new.build_from_hash(attributes)
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ self.class.openapi_types.each_pair do |key, type|
337
+ if type =~ /\AArray<(.*)>/i
338
+ # check to ensure the input is an array given that the attribute
339
+ # is documented as an array but the input is not
340
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
341
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
342
+ end
343
+ elsif !attributes[self.class.attribute_map[key]].nil?
344
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
345
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
346
+ end
347
+
348
+ self
349
+ end
350
+
351
+ # Deserializes the data based on type
352
+ # @param string type Data type
353
+ # @param string value Value to be deserialized
354
+ # @return [Object] Deserialized data
355
+ def _deserialize(type, value)
356
+ case type.to_sym
357
+ when :DateTime
358
+ DateTime.parse(value)
359
+ when :Date
360
+ Date.parse(value)
361
+ when :String
362
+ value.to_s
363
+ when :Integer
364
+ value.to_i
365
+ when :Float
366
+ value.to_f
367
+ when :Boolean
368
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
369
+ true
370
+ else
371
+ false
372
+ end
373
+ when :Object
374
+ # generic object (usually a Hash), return directly
375
+ value
376
+ when /\AArray<(?<inner_type>.+)>\z/
377
+ inner_type = Regexp.last_match[:inner_type]
378
+ value.map { |v| _deserialize(inner_type, v) }
379
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
380
+ k_type = Regexp.last_match[:k_type]
381
+ v_type = Regexp.last_match[:v_type]
382
+ {}.tap do |hash|
383
+ value.each do |k, v|
384
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
385
+ end
386
+ end
387
+ else # model
388
+ Hubspot::Files::Files.const_get(type).build_from_hash(value)
389
+ end
390
+ end
391
+
392
+ # Returns the string representation of the object
393
+ # @return [String] String presentation of the object
394
+ def to_s
395
+ to_hash.to_s
396
+ end
397
+
398
+ # to_body is an alias to to_hash (backward compatibility)
399
+ # @return [Hash] Returns the object in the form of hash
400
+ def to_body
401
+ to_hash
402
+ end
403
+
404
+ # Returns the object in the form of hash
405
+ # @return [Hash] Returns the object in the form of hash
406
+ def to_hash
407
+ hash = {}
408
+ self.class.attribute_map.each_pair do |attr, param|
409
+ value = self.send(attr)
410
+ if value.nil?
411
+ is_nullable = self.class.openapi_nullable.include?(attr)
412
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
413
+ end
414
+
415
+ hash[param] = _to_hash(value)
416
+ end
417
+ hash
418
+ end
419
+
420
+ # Outputs non-array value in the form of hash
421
+ # For object, use to_hash. Otherwise, just return the value
422
+ # @param [Object] value Any valid value
423
+ # @return [Hash] Returns the value in the form of hash
424
+ def _to_hash(value)
425
+ if value.is_a?(Array)
426
+ value.compact.map { |v| _to_hash(v) }
427
+ elsif value.is_a?(Hash)
428
+ {}.tap do |hash|
429
+ value.each { |k, v| hash[k] = _to_hash(v) }
430
+ end
431
+ elsif value.respond_to? :to_hash
432
+ value.to_hash
433
+ else
434
+ value
435
+ end
436
+ end
437
+ end
438
+ end
439
+ end
440
+ end
@@ -0,0 +1,348 @@
1
+ =begin
2
+ #Files
3
+
4
+ #Upload and manage files.
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Hubspot
16
+ module Files
17
+ module Files
18
+ class FileActionResponse
19
+ # Current status of the task.
20
+ attr_accessor :status
21
+
22
+ attr_accessor :result
23
+
24
+ # Number of errors resulting from the task.
25
+ attr_accessor :num_errors
26
+
27
+ # Descriptive error messages.
28
+ attr_accessor :errors
29
+
30
+ # Timestamp of when the task was requested.
31
+ attr_accessor :requested_at
32
+
33
+ # Timestamp of when the task was started.
34
+ attr_accessor :started_at
35
+
36
+ # Time of completion of task.
37
+ attr_accessor :completed_at
38
+
39
+ # Link to check the status of the requested task.
40
+ attr_accessor :links
41
+
42
+ # If of the requested task.
43
+ attr_accessor :task_id
44
+
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'status' => :'status',
71
+ :'result' => :'result',
72
+ :'num_errors' => :'numErrors',
73
+ :'errors' => :'errors',
74
+ :'requested_at' => :'requestedAt',
75
+ :'started_at' => :'startedAt',
76
+ :'completed_at' => :'completedAt',
77
+ :'links' => :'links',
78
+ :'task_id' => :'taskId'
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'status' => :'String',
86
+ :'result' => :'File',
87
+ :'num_errors' => :'Integer',
88
+ :'errors' => :'Array<StandardError>',
89
+ :'requested_at' => :'DateTime',
90
+ :'started_at' => :'DateTime',
91
+ :'completed_at' => :'DateTime',
92
+ :'links' => :'Hash<String, String>',
93
+ :'task_id' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Files::Files::FileActionResponse` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Files::Files::FileActionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'status')
119
+ self.status = attributes[:'status']
120
+ end
121
+
122
+ if attributes.key?(:'result')
123
+ self.result = attributes[:'result']
124
+ end
125
+
126
+ if attributes.key?(:'num_errors')
127
+ self.num_errors = attributes[:'num_errors']
128
+ end
129
+
130
+ if attributes.key?(:'errors')
131
+ if (value = attributes[:'errors']).is_a?(Array)
132
+ self.errors = value
133
+ end
134
+ end
135
+
136
+ if attributes.key?(:'requested_at')
137
+ self.requested_at = attributes[:'requested_at']
138
+ end
139
+
140
+ if attributes.key?(:'started_at')
141
+ self.started_at = attributes[:'started_at']
142
+ end
143
+
144
+ if attributes.key?(:'completed_at')
145
+ self.completed_at = attributes[:'completed_at']
146
+ end
147
+
148
+ if attributes.key?(:'links')
149
+ if (value = attributes[:'links']).is_a?(Hash)
150
+ self.links = value
151
+ end
152
+ end
153
+
154
+ if attributes.key?(:'task_id')
155
+ self.task_id = attributes[:'task_id']
156
+ end
157
+ end
158
+
159
+ # Show invalid properties with the reasons. Usually used together with valid?
160
+ # @return Array for valid properties with the reasons
161
+ def list_invalid_properties
162
+ invalid_properties = Array.new
163
+ if @status.nil?
164
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
165
+ end
166
+
167
+ if @started_at.nil?
168
+ invalid_properties.push('invalid value for "started_at", started_at cannot be nil.')
169
+ end
170
+
171
+ if @completed_at.nil?
172
+ invalid_properties.push('invalid value for "completed_at", completed_at cannot be nil.')
173
+ end
174
+
175
+ if @task_id.nil?
176
+ invalid_properties.push('invalid value for "task_id", task_id cannot be nil.')
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ return false if @status.nil?
186
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"])
187
+ return false unless status_validator.valid?(@status)
188
+ return false if @started_at.nil?
189
+ return false if @completed_at.nil?
190
+ return false if @task_id.nil?
191
+ true
192
+ end
193
+
194
+ # Custom attribute writer method checking allowed values (enum).
195
+ # @param [Object] status Object to be assigned
196
+ def status=(status)
197
+ validator = EnumAttributeValidator.new('String', ["PENDING", "PROCESSING", "CANCELED", "COMPLETE"])
198
+ unless validator.valid?(status)
199
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
200
+ end
201
+ @status = status
202
+ end
203
+
204
+ # Checks equality by comparing each attribute.
205
+ # @param [Object] Object to be compared
206
+ def ==(o)
207
+ return true if self.equal?(o)
208
+ self.class == o.class &&
209
+ status == o.status &&
210
+ result == o.result &&
211
+ num_errors == o.num_errors &&
212
+ errors == o.errors &&
213
+ requested_at == o.requested_at &&
214
+ started_at == o.started_at &&
215
+ completed_at == o.completed_at &&
216
+ links == o.links &&
217
+ task_id == o.task_id
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Integer] Hash code
228
+ def hash
229
+ [status, result, num_errors, errors, requested_at, started_at, completed_at, links, task_id].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def self.build_from_hash(attributes)
236
+ new.build_from_hash(attributes)
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def build_from_hash(attributes)
243
+ return nil unless attributes.is_a?(Hash)
244
+ self.class.openapi_types.each_pair do |key, type|
245
+ if type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
249
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
250
+ end
251
+ elsif !attributes[self.class.attribute_map[key]].nil?
252
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
253
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
254
+ end
255
+
256
+ self
257
+ end
258
+
259
+ # Deserializes the data based on type
260
+ # @param string type Data type
261
+ # @param string value Value to be deserialized
262
+ # @return [Object] Deserialized data
263
+ def _deserialize(type, value)
264
+ case type.to_sym
265
+ when :DateTime
266
+ DateTime.parse(value)
267
+ when :Date
268
+ Date.parse(value)
269
+ when :String
270
+ value.to_s
271
+ when :Integer
272
+ value.to_i
273
+ when :Float
274
+ value.to_f
275
+ when :Boolean
276
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
277
+ true
278
+ else
279
+ false
280
+ end
281
+ when :Object
282
+ # generic object (usually a Hash), return directly
283
+ value
284
+ when /\AArray<(?<inner_type>.+)>\z/
285
+ inner_type = Regexp.last_match[:inner_type]
286
+ value.map { |v| _deserialize(inner_type, v) }
287
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
288
+ k_type = Regexp.last_match[:k_type]
289
+ v_type = Regexp.last_match[:v_type]
290
+ {}.tap do |hash|
291
+ value.each do |k, v|
292
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
293
+ end
294
+ end
295
+ else # model
296
+ Hubspot::Files::Files.const_get(type).build_from_hash(value)
297
+ end
298
+ end
299
+
300
+ # Returns the string representation of the object
301
+ # @return [String] String presentation of the object
302
+ def to_s
303
+ to_hash.to_s
304
+ end
305
+
306
+ # to_body is an alias to to_hash (backward compatibility)
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_body
309
+ to_hash
310
+ end
311
+
312
+ # Returns the object in the form of hash
313
+ # @return [Hash] Returns the object in the form of hash
314
+ def to_hash
315
+ hash = {}
316
+ self.class.attribute_map.each_pair do |attr, param|
317
+ value = self.send(attr)
318
+ if value.nil?
319
+ is_nullable = self.class.openapi_nullable.include?(attr)
320
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
321
+ end
322
+
323
+ hash[param] = _to_hash(value)
324
+ end
325
+ hash
326
+ end
327
+
328
+ # Outputs non-array value in the form of hash
329
+ # For object, use to_hash. Otherwise, just return the value
330
+ # @param [Object] value Any valid value
331
+ # @return [Hash] Returns the value in the form of hash
332
+ def _to_hash(value)
333
+ if value.is_a?(Array)
334
+ value.compact.map { |v| _to_hash(v) }
335
+ elsif value.is_a?(Hash)
336
+ {}.tap do |hash|
337
+ value.each { |k, v| hash[k] = _to_hash(v) }
338
+ end
339
+ elsif value.respond_to? :to_hash
340
+ value.to_hash
341
+ else
342
+ value
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
348
+ end