hubspot-api-client 9.5.0 → 10.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (377) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/Gemfile.lock +4 -4
  4. data/LICENSE +201 -0
  5. data/README.md +1 -1
  6. data/hubspot-api-client.gemspec +1 -1
  7. data/lib/hubspot/codegen/automation/actions/api_client.rb +14 -0
  8. data/lib/hubspot/codegen/cms/audit-logs/api_client.rb +14 -0
  9. data/lib/hubspot/codegen/cms/blogs/authors/api/default_api.rb +2 -2
  10. data/lib/hubspot/codegen/cms/blogs/authors/api_client.rb +14 -0
  11. data/lib/hubspot/codegen/cms/blogs/blog-posts/api/default_api.rb +2 -2
  12. data/lib/hubspot/codegen/cms/blogs/blog-posts/api_client.rb +14 -0
  13. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/blog_post.rb +108 -102
  14. data/lib/hubspot/codegen/cms/blogs/blog-posts/models/layout_section.rb +4 -2
  15. data/lib/hubspot/codegen/cms/blogs/tags/api/default_api.rb +2 -2
  16. data/lib/hubspot/codegen/cms/blogs/tags/api_client.rb +14 -0
  17. data/lib/hubspot/codegen/cms/domains/api_client.rb +14 -0
  18. data/lib/hubspot/codegen/cms/hubdb/api/rows_api.rb +1 -1
  19. data/lib/hubspot/codegen/cms/hubdb/api/rows_batch_api.rb +1 -1
  20. data/lib/hubspot/codegen/cms/hubdb/api/tables_api.rb +1 -1
  21. data/lib/hubspot/codegen/cms/hubdb/api_client.rb +15 -1
  22. data/lib/hubspot/codegen/cms/hubdb/api_error.rb +1 -1
  23. data/lib/hubspot/codegen/cms/hubdb/configuration.rb +1 -1
  24. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_hub_db_table_row_v3.rb +1 -1
  25. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_json_node.rb +1 -1
  26. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_string.rb +1 -1
  27. data/lib/hubspot/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors.rb +1 -1
  28. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging.rb +1 -1
  29. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging.rb +1 -1
  30. data/lib/hubspot/codegen/cms/hubdb/models/column.rb +1 -1
  31. data/lib/hubspot/codegen/cms/hubdb/models/column_input.rb +1 -1
  32. data/lib/hubspot/codegen/cms/hubdb/models/error.rb +1 -1
  33. data/lib/hubspot/codegen/cms/hubdb/models/error_detail.rb +1 -1
  34. data/lib/hubspot/codegen/cms/hubdb/models/foreign_id.rb +1 -1
  35. data/lib/hubspot/codegen/cms/hubdb/models/forward_paging.rb +1 -1
  36. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_clone_request.rb +1 -1
  37. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3.rb +5 -3
  38. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3_input.rb +1 -1
  39. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3.rb +1 -1
  40. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_input.rb +1 -1
  41. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_live_input.rb +1 -1
  42. data/lib/hubspot/codegen/cms/hubdb/models/import_result.rb +1 -1
  43. data/lib/hubspot/codegen/cms/hubdb/models/next_page.rb +1 -1
  44. data/lib/hubspot/codegen/cms/hubdb/models/option.rb +1 -1
  45. data/lib/hubspot/codegen/cms/hubdb/models/simple_user.rb +1 -1
  46. data/lib/hubspot/codegen/cms/hubdb/models/standard_error.rb +1 -1
  47. data/lib/hubspot/codegen/cms/performance/api_client.rb +14 -0
  48. data/lib/hubspot/codegen/cms/site-search/api/default_api.rb +2 -5
  49. data/lib/hubspot/codegen/cms/site-search/api_client.rb +14 -0
  50. data/lib/hubspot/codegen/cms/site-search/models/content_search_result.rb +19 -2
  51. data/lib/hubspot/codegen/cms/site-search/models/indexed_data.rb +5 -2
  52. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +17 -15
  53. data/lib/hubspot/codegen/cms/url-redirects/api_client.rb +14 -0
  54. data/lib/hubspot/codegen/communication_preferences/api/definition_api.rb +80 -0
  55. data/lib/hubspot/codegen/communication_preferences/api/status_api.rb +214 -0
  56. data/lib/hubspot/codegen/communication_preferences/api_client.rb +404 -0
  57. data/lib/hubspot/codegen/communication_preferences/api_error.rb +59 -0
  58. data/lib/hubspot/codegen/communication_preferences/configuration.rb +254 -0
  59. data/lib/hubspot/codegen/communication_preferences/models/error.rb +290 -0
  60. data/lib/hubspot/codegen/communication_preferences/models/error_detail.rb +256 -0
  61. data/lib/hubspot/codegen/communication_preferences/models/public_subscription_status.rb +372 -0
  62. data/lib/hubspot/codegen/communication_preferences/models/public_subscription_statuses_response.rb +231 -0
  63. data/lib/hubspot/codegen/communication_preferences/models/public_update_subscription_status_request.rb +283 -0
  64. data/lib/hubspot/codegen/communication_preferences/models/subscription_definition.rb +339 -0
  65. data/lib/hubspot/codegen/communication_preferences/models/subscription_definitions_response.rb +216 -0
  66. data/lib/hubspot/codegen/conversations/visitor-identification/api_client.rb +14 -0
  67. data/lib/hubspot/codegen/crm/associations/api_client.rb +14 -0
  68. data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +6 -12
  69. data/lib/hubspot/codegen/crm/companies/api/basic_api.rb +11 -14
  70. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +3 -3
  71. data/lib/hubspot/codegen/crm/companies/api_client.rb +14 -0
  72. data/lib/hubspot/codegen/crm/companies/models/batch_read_input_simple_public_object_id.rb +20 -20
  73. data/lib/hubspot/codegen/crm/companies/models/collection_response_associated_id_forward_paging.rb +226 -0
  74. data/lib/hubspot/codegen/crm/companies/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  75. data/lib/hubspot/codegen/crm/companies/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  76. data/lib/hubspot/codegen/crm/companies/models/forward_paging.rb +210 -0
  77. data/lib/hubspot/codegen/crm/companies/models/simple_public_object.rb +1 -12
  78. data/lib/hubspot/codegen/crm/companies/models/simple_public_object_with_associations.rb +288 -0
  79. data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +6 -12
  80. data/lib/hubspot/codegen/crm/contacts/api/basic_api.rb +11 -14
  81. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +3 -3
  82. data/lib/hubspot/codegen/crm/contacts/api_client.rb +14 -0
  83. data/lib/hubspot/codegen/crm/contacts/models/batch_read_input_simple_public_object_id.rb +20 -20
  84. data/lib/hubspot/codegen/crm/contacts/models/collection_response_associated_id_forward_paging.rb +226 -0
  85. data/lib/hubspot/codegen/crm/contacts/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  86. data/lib/hubspot/codegen/crm/contacts/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  87. data/lib/hubspot/codegen/crm/contacts/models/forward_paging.rb +210 -0
  88. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object.rb +1 -12
  89. data/lib/hubspot/codegen/crm/contacts/models/simple_public_object_with_associations.rb +288 -0
  90. data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +6 -12
  91. data/lib/hubspot/codegen/crm/deals/api/basic_api.rb +11 -14
  92. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +3 -3
  93. data/lib/hubspot/codegen/crm/deals/api_client.rb +14 -0
  94. data/lib/hubspot/codegen/crm/deals/models/batch_read_input_simple_public_object_id.rb +20 -20
  95. data/lib/hubspot/codegen/crm/deals/models/collection_response_associated_id_forward_paging.rb +226 -0
  96. data/lib/hubspot/codegen/crm/deals/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  97. data/lib/hubspot/codegen/crm/deals/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  98. data/lib/hubspot/codegen/crm/deals/models/forward_paging.rb +210 -0
  99. data/lib/hubspot/codegen/crm/deals/models/simple_public_object.rb +1 -12
  100. data/lib/hubspot/codegen/crm/deals/models/simple_public_object_with_associations.rb +288 -0
  101. data/lib/hubspot/codegen/crm/extensions/accounting/api_client.rb +14 -0
  102. data/lib/hubspot/codegen/crm/extensions/calling/api/settings_api.rb +24 -16
  103. data/lib/hubspot/codegen/crm/extensions/calling/api_client.rb +14 -0
  104. data/lib/hubspot/codegen/crm/extensions/calling/configuration.rb +1 -1
  105. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_patch_request.rb +14 -4
  106. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_request.rb +14 -4
  107. data/lib/hubspot/codegen/crm/extensions/calling/models/settings_response.rb +16 -1
  108. data/lib/hubspot/codegen/crm/extensions/cards/api/cards_api.rb +25 -17
  109. data/lib/hubspot/codegen/crm/extensions/cards/api_client.rb +14 -0
  110. data/lib/hubspot/codegen/crm/extensions/cards/configuration.rb +1 -1
  111. data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_client.rb +14 -0
  112. data/lib/hubspot/codegen/crm/imports/api/default_api.rb +90 -0
  113. data/lib/hubspot/codegen/crm/imports/api_client.rb +14 -0
  114. data/lib/hubspot/codegen/crm/imports/models/collection_response_public_import_error_forward_paging.rb +226 -0
  115. data/lib/hubspot/codegen/crm/{schemas/models/paging.rb → imports/models/forward_paging.rb} +11 -20
  116. data/lib/hubspot/codegen/crm/imports/models/import_row_core.rb +238 -0
  117. data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +353 -0
  118. data/lib/hubspot/codegen/crm/imports/models/public_import_response.rb +2 -2
  119. data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +6 -12
  120. data/lib/hubspot/codegen/crm/line_items/api/basic_api.rb +11 -14
  121. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +3 -3
  122. data/lib/hubspot/codegen/crm/line_items/api_client.rb +14 -0
  123. data/lib/hubspot/codegen/crm/line_items/models/batch_read_input_simple_public_object_id.rb +20 -20
  124. data/lib/hubspot/codegen/crm/line_items/models/collection_response_associated_id_forward_paging.rb +226 -0
  125. data/lib/hubspot/codegen/crm/line_items/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  126. data/lib/hubspot/codegen/crm/line_items/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  127. data/lib/hubspot/codegen/crm/line_items/models/forward_paging.rb +210 -0
  128. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object.rb +1 -12
  129. data/lib/hubspot/codegen/crm/line_items/models/simple_public_object_with_associations.rb +288 -0
  130. data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +6 -12
  131. data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +11 -14
  132. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +10 -10
  133. data/lib/hubspot/codegen/crm/objects/api_client.rb +14 -0
  134. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +3 -6
  135. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +6 -12
  136. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +3 -3
  137. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_client.rb +14 -0
  138. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id.rb +20 -20
  139. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/{collection_response_simple_public_object.rb → collection_response_associated_id_forward_paging.rb} +5 -5
  140. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/collection_response_simple_public_object_with_associations_forward_paging.rb +228 -0
  141. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  142. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/forward_paging.rb +212 -0
  143. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object.rb +1 -12
  144. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations.rb +290 -0
  145. data/lib/hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id.rb +20 -20
  146. data/lib/hubspot/codegen/crm/objects/models/collection_response_associated_id_forward_paging.rb +226 -0
  147. data/lib/hubspot/codegen/crm/objects/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  148. data/lib/hubspot/codegen/crm/objects/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  149. data/lib/hubspot/codegen/crm/objects/models/forward_paging.rb +210 -0
  150. data/lib/hubspot/codegen/crm/objects/models/simple_public_object.rb +1 -12
  151. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_with_associations.rb +288 -0
  152. data/lib/hubspot/codegen/crm/owners/api/default_api.rb +9 -3
  153. data/lib/hubspot/codegen/crm/owners/api_client.rb +14 -0
  154. data/lib/hubspot/codegen/crm/owners/models/{collection_response_public_owner.rb → collection_response_public_owner_forward_paging.rb} +4 -4
  155. data/lib/hubspot/codegen/crm/owners/models/{paging.rb → forward_paging.rb} +3 -3
  156. data/lib/hubspot/codegen/crm/pipelines/api_client.rb +14 -0
  157. data/lib/hubspot/codegen/crm/products/api/associations_api.rb +6 -12
  158. data/lib/hubspot/codegen/crm/products/api/basic_api.rb +11 -14
  159. data/lib/hubspot/codegen/crm/products/api/search_api.rb +3 -3
  160. data/lib/hubspot/codegen/crm/products/api_client.rb +14 -0
  161. data/lib/hubspot/codegen/crm/products/models/batch_read_input_simple_public_object_id.rb +20 -20
  162. data/lib/hubspot/codegen/crm/products/models/collection_response_associated_id_forward_paging.rb +226 -0
  163. data/lib/hubspot/codegen/crm/products/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  164. data/lib/hubspot/codegen/crm/products/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  165. data/lib/hubspot/codegen/crm/products/models/forward_paging.rb +210 -0
  166. data/lib/hubspot/codegen/crm/products/models/simple_public_object.rb +1 -12
  167. data/lib/hubspot/codegen/crm/products/models/simple_public_object_with_associations.rb +288 -0
  168. data/lib/hubspot/codegen/crm/properties/api_client.rb +14 -0
  169. data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +3 -6
  170. data/lib/hubspot/codegen/crm/quotes/api/basic_api.rb +6 -12
  171. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +3 -3
  172. data/lib/hubspot/codegen/crm/quotes/api_client.rb +14 -0
  173. data/lib/hubspot/codegen/crm/quotes/models/batch_read_input_simple_public_object_id.rb +20 -20
  174. data/lib/hubspot/codegen/crm/quotes/models/collection_response_associated_id_forward_paging.rb +226 -0
  175. data/lib/hubspot/codegen/crm/quotes/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  176. data/lib/hubspot/codegen/crm/quotes/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  177. data/lib/hubspot/codegen/crm/{schemas/models/previous_page.rb → quotes/models/forward_paging.rb} +14 -28
  178. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object.rb +1 -12
  179. data/lib/hubspot/codegen/crm/quotes/models/simple_public_object_with_associations.rb +288 -0
  180. data/lib/hubspot/codegen/crm/schemas/api/core_api.rb +23 -17
  181. data/lib/hubspot/codegen/crm/schemas/api_client.rb +14 -0
  182. data/lib/hubspot/codegen/crm/schemas/models/association_definition.rb +1 -75
  183. data/lib/hubspot/codegen/crm/schemas/models/association_definition_egg.rb +4 -78
  184. data/lib/hubspot/codegen/crm/schemas/models/{collection_response_object_schema.rb → collection_response_object_schema_no_paging.rb} +7 -16
  185. data/lib/hubspot/codegen/crm/schemas/models/object_schema.rb +15 -1
  186. data/lib/hubspot/codegen/crm/schemas/models/object_type_definition.rb +15 -1
  187. data/lib/hubspot/codegen/crm/schemas/models/object_type_property_create.rb +2 -2
  188. data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +6 -12
  189. data/lib/hubspot/codegen/crm/tickets/api/basic_api.rb +11 -14
  190. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +3 -3
  191. data/lib/hubspot/codegen/crm/tickets/api_client.rb +14 -0
  192. data/lib/hubspot/codegen/crm/tickets/models/batch_read_input_simple_public_object_id.rb +20 -20
  193. data/lib/hubspot/codegen/crm/tickets/models/collection_response_associated_id_forward_paging.rb +226 -0
  194. data/lib/hubspot/codegen/crm/tickets/models/{collection_response_simple_public_object.rb → collection_response_simple_public_object_with_associations_forward_paging.rb} +5 -5
  195. data/lib/hubspot/codegen/crm/tickets/models/{collection_response_with_total_simple_public_object.rb → collection_response_with_total_simple_public_object_forward_paging.rb} +4 -5
  196. data/lib/hubspot/codegen/crm/tickets/models/forward_paging.rb +210 -0
  197. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object.rb +1 -12
  198. data/lib/hubspot/codegen/crm/tickets/models/simple_public_object_with_associations.rb +288 -0
  199. data/lib/hubspot/codegen/crm/timeline/api_client.rb +14 -0
  200. data/lib/hubspot/codegen/events/api_client.rb +14 -0
  201. data/lib/hubspot/codegen/files/files/api/files_api.rb +8 -8
  202. data/lib/hubspot/codegen/files/files/api_client.rb +14 -0
  203. data/lib/hubspot/codegen/files/files/models/file_update_input.rb +2 -2
  204. data/lib/hubspot/codegen/files/files/models/{file.rb → hubspot_file.rb} +3 -3
  205. data/lib/hubspot/codegen/files/files/models/import_from_url_input.rb +2 -2
  206. data/lib/hubspot/codegen/marketing/transactional/api/default_api.rb +60 -60
  207. data/lib/hubspot/codegen/marketing/transactional/api_client.rb +14 -0
  208. data/lib/hubspot/codegen/oauth/api_client.rb +14 -0
  209. data/lib/hubspot/codegen/webhooks/api_client.rb +14 -0
  210. data/lib/hubspot/version.rb +1 -1
  211. data/spec/codegen/cms/blogs/authors/api/default_api_spec.rb +24 -24
  212. data/spec/codegen/cms/blogs/blog-posts/api/default_api_spec.rb +26 -26
  213. data/spec/codegen/cms/blogs/blog-posts/models/blog_post_spec.rb +14 -14
  214. data/spec/codegen/cms/blogs/tags/api/default_api_spec.rb +24 -24
  215. data/spec/codegen/cms/hubdb/api/rows_api_spec.rb +1 -1
  216. data/spec/codegen/cms/hubdb/api/rows_batch_api_spec.rb +1 -1
  217. data/spec/codegen/cms/hubdb/api/tables_api_spec.rb +1 -1
  218. data/spec/codegen/cms/hubdb/models/batch_input_hub_db_table_row_v3_spec.rb +1 -1
  219. data/spec/codegen/cms/hubdb/models/batch_input_json_node_spec.rb +1 -1
  220. data/spec/codegen/cms/hubdb/models/batch_input_string_spec.rb +1 -1
  221. data/spec/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors_spec.rb +1 -1
  222. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging_spec.rb +1 -1
  223. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging_spec.rb +1 -1
  224. data/spec/codegen/cms/hubdb/models/column_input_spec.rb +1 -1
  225. data/spec/codegen/cms/hubdb/models/column_spec.rb +1 -1
  226. data/spec/codegen/cms/hubdb/models/error_detail_spec.rb +1 -1
  227. data/spec/codegen/cms/hubdb/models/error_spec.rb +1 -1
  228. data/spec/codegen/cms/hubdb/models/foreign_id_spec.rb +1 -1
  229. data/spec/codegen/cms/hubdb/models/forward_paging_spec.rb +1 -1
  230. data/spec/codegen/cms/hubdb/models/hub_db_table_clone_request_spec.rb +1 -1
  231. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_input_spec.rb +1 -1
  232. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_spec.rb +1 -1
  233. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_input_spec.rb +1 -1
  234. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_live_input_spec.rb +1 -1
  235. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_spec.rb +1 -1
  236. data/spec/codegen/cms/hubdb/models/import_result_spec.rb +1 -1
  237. data/spec/codegen/cms/hubdb/models/next_page_spec.rb +1 -1
  238. data/spec/codegen/cms/hubdb/models/option_spec.rb +1 -1
  239. data/spec/codegen/cms/hubdb/models/simple_user_spec.rb +1 -1
  240. data/spec/codegen/cms/hubdb/models/standard_error_spec.rb +1 -1
  241. data/spec/codegen/cms/site-search/api/default_api_spec.rb +0 -1
  242. data/spec/codegen/cms/site-search/models/content_search_result_spec.rb +1 -1
  243. data/spec/codegen/cms/site-search/models/indexed_data_spec.rb +1 -1
  244. data/spec/codegen/cms/site-search/models/search_hit_field_spec.rb +2 -2
  245. data/spec/codegen/communication_preferences/api/definition_api_spec.rb +46 -0
  246. data/spec/codegen/communication_preferences/api/status_api_spec.rb +71 -0
  247. data/spec/codegen/communication_preferences/models/error_detail_spec.rb +65 -0
  248. data/spec/codegen/communication_preferences/models/error_spec.rb +77 -0
  249. data/spec/codegen/communication_preferences/models/public_subscription_status_spec.rb +101 -0
  250. data/spec/codegen/communication_preferences/models/public_subscription_statuses_response_spec.rb +47 -0
  251. data/spec/codegen/communication_preferences/models/public_update_subscription_status_request_spec.rb +63 -0
  252. data/spec/codegen/communication_preferences/models/subscription_definition_spec.rb +95 -0
  253. data/spec/codegen/communication_preferences/models/subscription_definitions_response_spec.rb +41 -0
  254. data/spec/codegen/crm/companies/api/associations_api_spec.rb +2 -4
  255. data/spec/codegen/crm/companies/api/basic_api_spec.rb +4 -5
  256. data/spec/codegen/crm/companies/api/search_api_spec.rb +1 -1
  257. data/spec/codegen/crm/companies/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  258. data/spec/codegen/crm/companies/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  259. data/spec/codegen/crm/companies/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  260. data/spec/codegen/crm/companies/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  261. data/spec/codegen/crm/companies/models/forward_paging_spec.rb +41 -0
  262. data/spec/codegen/crm/companies/models/simple_public_object_spec.rb +0 -6
  263. data/spec/codegen/crm/companies/models/simple_public_object_with_associations_spec.rb +77 -0
  264. data/spec/codegen/crm/contacts/api/associations_api_spec.rb +2 -4
  265. data/spec/codegen/crm/contacts/api/basic_api_spec.rb +4 -5
  266. data/spec/codegen/crm/contacts/api/search_api_spec.rb +1 -1
  267. data/spec/codegen/crm/contacts/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  268. data/spec/codegen/crm/contacts/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  269. data/spec/codegen/crm/contacts/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  270. data/spec/codegen/crm/contacts/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  271. data/spec/codegen/crm/contacts/models/forward_paging_spec.rb +41 -0
  272. data/spec/codegen/crm/contacts/models/simple_public_object_spec.rb +0 -6
  273. data/spec/codegen/crm/contacts/models/simple_public_object_with_associations_spec.rb +77 -0
  274. data/spec/codegen/crm/deals/api/associations_api_spec.rb +2 -4
  275. data/spec/codegen/crm/deals/api/basic_api_spec.rb +4 -5
  276. data/spec/codegen/crm/deals/api/search_api_spec.rb +1 -1
  277. data/spec/codegen/crm/deals/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  278. data/spec/codegen/crm/deals/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  279. data/spec/codegen/crm/deals/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  280. data/spec/codegen/crm/deals/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  281. data/spec/codegen/crm/deals/models/forward_paging_spec.rb +41 -0
  282. data/spec/codegen/crm/deals/models/simple_public_object_spec.rb +0 -6
  283. data/spec/codegen/crm/deals/models/simple_public_object_with_associations_spec.rb +77 -0
  284. data/spec/codegen/crm/extensions/calling/api/settings_api_spec.rb +2 -2
  285. data/spec/codegen/crm/extensions/calling/models/settings_patch_request_spec.rb +6 -0
  286. data/spec/codegen/crm/extensions/calling/models/settings_request_spec.rb +6 -0
  287. data/spec/codegen/crm/extensions/calling/models/settings_response_spec.rb +6 -0
  288. data/spec/codegen/crm/extensions/cards/api/cards_api_spec.rb +2 -2
  289. data/spec/codegen/crm/imports/api/default_api_spec.rb +47 -0
  290. data/spec/codegen/crm/imports/models/collection_response_public_import_error_forward_paging_spec.rb +47 -0
  291. data/spec/codegen/crm/imports/models/forward_paging_spec.rb +41 -0
  292. data/spec/codegen/crm/imports/models/import_row_core_spec.rb +53 -0
  293. data/spec/codegen/crm/imports/models/public_import_error_spec.rb +97 -0
  294. data/spec/codegen/crm/imports/models/public_import_response_spec.rb +1 -1
  295. data/spec/codegen/crm/line_items/api/associations_api_spec.rb +2 -4
  296. data/spec/codegen/crm/line_items/api/basic_api_spec.rb +4 -5
  297. data/spec/codegen/crm/line_items/api/search_api_spec.rb +1 -1
  298. data/spec/codegen/crm/line_items/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  299. data/spec/codegen/crm/line_items/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  300. data/spec/codegen/crm/line_items/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  301. data/spec/codegen/crm/line_items/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  302. data/spec/codegen/crm/line_items/models/forward_paging_spec.rb +41 -0
  303. data/spec/codegen/crm/line_items/models/simple_public_object_spec.rb +0 -6
  304. data/spec/codegen/crm/line_items/models/simple_public_object_with_associations_spec.rb +77 -0
  305. data/spec/codegen/crm/objects/api/associations_api_spec.rb +2 -4
  306. data/spec/codegen/crm/objects/api/basic_api_spec.rb +4 -5
  307. data/spec/codegen/crm/objects/api/search_api_spec.rb +3 -3
  308. data/spec/codegen/crm/objects/feedback_submissions/api/associations_api_spec.rb +1 -2
  309. data/spec/codegen/crm/objects/feedback_submissions/api/basic_api_spec.rb +2 -4
  310. data/spec/codegen/crm/objects/feedback_submissions/api/search_api_spec.rb +1 -1
  311. data/spec/codegen/crm/objects/feedback_submissions/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  312. data/spec/codegen/crm/objects/feedback_submissions/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  313. data/spec/codegen/crm/objects/feedback_submissions/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  314. data/spec/codegen/crm/objects/feedback_submissions/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  315. data/spec/codegen/crm/objects/feedback_submissions/models/forward_paging_spec.rb +41 -0
  316. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_spec.rb +0 -6
  317. data/spec/codegen/crm/objects/feedback_submissions/models/simple_public_object_with_associations_spec.rb +77 -0
  318. data/spec/codegen/crm/objects/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  319. data/spec/codegen/crm/objects/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  320. data/spec/codegen/crm/objects/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  321. data/spec/codegen/crm/objects/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  322. data/spec/codegen/crm/objects/models/forward_paging_spec.rb +41 -0
  323. data/spec/codegen/crm/objects/models/simple_public_object_spec.rb +0 -6
  324. data/spec/codegen/crm/objects/models/simple_public_object_with_associations_spec.rb +77 -0
  325. data/spec/codegen/crm/owners/api/default_api_spec.rb +3 -1
  326. data/spec/codegen/crm/owners/models/{collection_response_public_owner_spec.rb → collection_response_public_owner_forward_paging_spec.rb} +6 -6
  327. data/spec/codegen/crm/owners/models/{paging_spec.rb → forward_paging_spec.rb} +6 -6
  328. data/spec/codegen/crm/products/api/associations_api_spec.rb +2 -4
  329. data/spec/codegen/crm/products/api/basic_api_spec.rb +4 -5
  330. data/spec/codegen/crm/products/api/search_api_spec.rb +1 -1
  331. data/spec/codegen/crm/products/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  332. data/spec/codegen/crm/products/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  333. data/spec/codegen/crm/products/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  334. data/spec/codegen/crm/products/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  335. data/spec/codegen/crm/products/models/forward_paging_spec.rb +41 -0
  336. data/spec/codegen/crm/products/models/simple_public_object_spec.rb +0 -6
  337. data/spec/codegen/crm/products/models/simple_public_object_with_associations_spec.rb +77 -0
  338. data/spec/codegen/crm/quotes/api/associations_api_spec.rb +1 -2
  339. data/spec/codegen/crm/quotes/api/basic_api_spec.rb +2 -4
  340. data/spec/codegen/crm/quotes/api/search_api_spec.rb +1 -1
  341. data/spec/codegen/crm/quotes/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  342. data/spec/codegen/crm/quotes/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  343. data/spec/codegen/crm/quotes/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  344. data/spec/codegen/crm/quotes/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  345. data/spec/codegen/crm/quotes/models/forward_paging_spec.rb +41 -0
  346. data/spec/codegen/crm/quotes/models/simple_public_object_spec.rb +0 -6
  347. data/spec/codegen/crm/quotes/models/simple_public_object_with_associations_spec.rb +77 -0
  348. data/spec/codegen/crm/schemas/api/core_api_spec.rb +10 -8
  349. data/spec/codegen/crm/schemas/models/association_definition_egg_spec.rb +0 -20
  350. data/spec/codegen/crm/schemas/models/association_definition_spec.rb +0 -20
  351. data/spec/codegen/crm/schemas/models/{collection_response_object_schema_spec.rb → collection_response_object_schema_no_paging_spec.rb} +6 -12
  352. data/spec/codegen/crm/schemas/models/object_schema_spec.rb +6 -0
  353. data/spec/codegen/crm/schemas/models/object_type_definition_spec.rb +6 -0
  354. data/spec/codegen/crm/schemas/models/object_type_property_create_spec.rb +1 -1
  355. data/spec/codegen/crm/tickets/api/associations_api_spec.rb +2 -4
  356. data/spec/codegen/crm/tickets/api/basic_api_spec.rb +4 -5
  357. data/spec/codegen/crm/tickets/api/search_api_spec.rb +1 -1
  358. data/spec/codegen/crm/tickets/models/batch_read_input_simple_public_object_id_spec.rb +3 -3
  359. data/spec/codegen/crm/tickets/models/collection_response_associated_id_forward_paging_spec.rb +47 -0
  360. data/spec/codegen/crm/tickets/models/{collection_response_simple_public_object_spec.rb → collection_response_simple_public_object_with_associations_forward_paging_spec.rb} +6 -6
  361. data/spec/codegen/crm/tickets/models/{collection_response_with_total_simple_public_object_spec.rb → collection_response_with_total_simple_public_object_forward_paging_spec.rb} +6 -6
  362. data/spec/codegen/crm/tickets/models/forward_paging_spec.rb +41 -0
  363. data/spec/codegen/crm/tickets/models/simple_public_object_spec.rb +0 -6
  364. data/spec/codegen/crm/tickets/models/simple_public_object_with_associations_spec.rb +77 -0
  365. data/spec/codegen/files/files/api/files_api_spec.rb +2 -2
  366. data/spec/codegen/files/files/models/file_update_input_spec.rb +1 -1
  367. data/spec/codegen/files/files/models/{file_spec.rb → hubspot_file_spec.rb} +5 -5
  368. data/spec/codegen/files/files/models/import_from_url_input_spec.rb +1 -1
  369. data/spec/codegen/marketing/transactional/api/default_api_spec.rb +12 -12
  370. data/spec/features/communication_preferences/definition_api_spec.rb +7 -0
  371. data/spec/features/communication_preferences/status_api_spec.rb +9 -0
  372. data/spec/features/crm/objects/search_api_spec.rb +1 -1
  373. metadata +200 -78
  374. data/lib/hubspot/codegen/crm/schemas/models/next_page.rb +0 -224
  375. data/spec/codegen/crm/schemas/models/next_page_spec.rb +0 -47
  376. data/spec/codegen/crm/schemas/models/paging_spec.rb +0 -47
  377. data/spec/codegen/crm/schemas/models/previous_page_spec.rb +0 -47
@@ -0,0 +1,254 @@
1
+ =begin
2
+ #Subscriptions
3
+
4
+ #Subscriptions allow contacts to control what forms of communications they receive. Contacts can decide whether they want to receive communication pertaining to a specific topic, brand, or an entire HubSpot account.
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
+ module Hubspot
14
+ module CommunicationPreferences
15
+ class Configuration
16
+ # Defines url scheme
17
+ attr_accessor :scheme
18
+
19
+ # Defines url host
20
+ attr_accessor :host
21
+
22
+ # Defines url base path
23
+ attr_accessor :base_path
24
+
25
+ # Defines API keys used with API Key authentications.
26
+ #
27
+ # @return [Hash] key: parameter name, value: parameter value (API key)
28
+ #
29
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
30
+ # config.api_key['api_key'] = 'xxx'
31
+ attr_accessor :api_key
32
+
33
+ # Defines API key prefixes used with API Key authentications.
34
+ #
35
+ # @return [Hash] key: parameter name, value: API key prefix
36
+ #
37
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
38
+ # config.api_key_prefix['api_key'] = 'Token'
39
+ attr_accessor :api_key_prefix
40
+
41
+ # Defines the username used with HTTP basic authentication.
42
+ #
43
+ # @return [String]
44
+ attr_accessor :username
45
+
46
+ # Defines the password used with HTTP basic authentication.
47
+ #
48
+ # @return [String]
49
+ attr_accessor :password
50
+
51
+ # Defines the access token (Bearer) used with OAuth2.
52
+ attr_accessor :access_token
53
+
54
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
55
+ # details will be logged with `logger.debug` (see the `logger` attribute).
56
+ # Default to false.
57
+ #
58
+ # @return [true, false]
59
+ attr_accessor :debugging
60
+
61
+ # Defines the logger used for debugging.
62
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
63
+ #
64
+ # @return [#debug]
65
+ attr_accessor :logger
66
+
67
+ # Defines the temporary folder to store downloaded files
68
+ # (for API endpoints that have file response).
69
+ # Default to use `Tempfile`.
70
+ #
71
+ # @return [String]
72
+ attr_accessor :temp_folder_path
73
+
74
+ # The time limit for HTTP request in seconds.
75
+ # Default to 0 (never times out).
76
+ attr_accessor :timeout
77
+
78
+ # Set this to false to skip client side validation in the operation.
79
+ # Default to true.
80
+ # @return [true, false]
81
+ attr_accessor :client_side_validation
82
+
83
+ ### TLS/SSL setting
84
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
85
+ # Default to true.
86
+ #
87
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
88
+ #
89
+ # @return [true, false]
90
+ attr_accessor :verify_ssl
91
+
92
+ ### TLS/SSL setting
93
+ # Set this to false to skip verifying SSL host name
94
+ # Default to true.
95
+ #
96
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
97
+ #
98
+ # @return [true, false]
99
+ attr_accessor :verify_ssl_host
100
+
101
+ ### TLS/SSL setting
102
+ # Set this to customize the certificate file to verify the peer.
103
+ #
104
+ # @return [String] the path to the certificate file
105
+ #
106
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
107
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
108
+ attr_accessor :ssl_ca_cert
109
+
110
+ ### TLS/SSL setting
111
+ # Client certificate file (for client certificate)
112
+ attr_accessor :cert_file
113
+
114
+ ### TLS/SSL setting
115
+ # Client private key file (for client certificate)
116
+ attr_accessor :key_file
117
+
118
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
119
+ # Default to nil.
120
+ #
121
+ # @see The params_encoding option of Ethon. Related source code:
122
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
123
+ attr_accessor :params_encoding
124
+
125
+ attr_accessor :inject_format
126
+
127
+ attr_accessor :force_ending_format
128
+
129
+ attr_accessor :error_handler
130
+
131
+ def initialize
132
+ @scheme = 'https'
133
+ @host = 'api.hubapi.com'
134
+ @base_path = ''
135
+ @api_key = {}
136
+ @api_key_prefix = {}
137
+ @timeout = 0
138
+ @client_side_validation = true
139
+ @verify_ssl = true
140
+ @verify_ssl_host = true
141
+ @params_encoding = nil
142
+ @cert_file = nil
143
+ @key_file = nil
144
+ @debugging = false
145
+ @inject_format = false
146
+ @force_ending_format = false
147
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
148
+ # error_handler params: { 'status_code': { max_retries: ..., seconds_delay: ... }, ... }
149
+ @error_handler = {}
150
+
151
+ yield(self) if block_given?
152
+ end
153
+
154
+ # The default Configuration object.
155
+ def self.default
156
+ @@default ||= Configuration.new
157
+ end
158
+
159
+ def configure
160
+ yield(self) if block_given?
161
+ end
162
+
163
+ def scheme=(scheme)
164
+ # remove :// from scheme
165
+ @scheme = scheme.sub(/:\/\//, '')
166
+ end
167
+
168
+ def host=(host)
169
+ # remove http(s):// and anything after a slash
170
+ @host = host.sub(/https?:\/\//, '').split('/').first
171
+ end
172
+
173
+ def base_path=(base_path)
174
+ # Add leading and trailing slashes to base_path
175
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
176
+ @base_path = '' if @base_path == '/'
177
+ end
178
+
179
+ def base_url
180
+ "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
181
+ end
182
+
183
+ # Gets API key (with prefix if set).
184
+ # @param [String] param_name the parameter name of API key auth
185
+ def api_key_with_prefix(param_name)
186
+ if @api_key_prefix[param_name]
187
+ "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
188
+ else
189
+ @api_key[param_name]
190
+ end
191
+ end
192
+
193
+ # Gets Basic Auth token string
194
+ def basic_auth_token
195
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
196
+ end
197
+
198
+ # Returns Auth Settings hash for api client.
199
+ def auth_settings
200
+ {
201
+ 'hapikey' =>
202
+ {
203
+ type: 'api_key',
204
+ in: 'query',
205
+ key: 'hapikey',
206
+ value: api_key_with_prefix('hapikey')
207
+ },
208
+ }
209
+ end
210
+
211
+ # Returns an array of Server setting
212
+ def server_settings
213
+ [
214
+ {
215
+ url: "https://api.hubapi.com/",
216
+ description: "No description provided",
217
+ }
218
+ ]
219
+ end
220
+
221
+ # Returns URL based on server settings
222
+ #
223
+ # @param index array index of the server settings
224
+ # @param variables hash of variable and the corresponding value
225
+ def server_url(index, variables = {})
226
+ servers = server_settings
227
+
228
+ # check array index out of bound
229
+ if (index < 0 || index >= servers.size)
230
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
231
+ end
232
+
233
+ server = servers[index]
234
+ url = server[:url]
235
+
236
+ # go through variable and assign a value
237
+ server[:variables].each do |name, variable|
238
+ if variables.key?(name)
239
+ if (server[:variables][name][:enum_values].include? variables[name])
240
+ url.gsub! "{" + name.to_s + "}", variables[name]
241
+ else
242
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
243
+ end
244
+ else
245
+ # use default value
246
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
247
+ end
248
+ end
249
+
250
+ url
251
+ end
252
+ end
253
+ end
254
+ end
@@ -0,0 +1,290 @@
1
+ =begin
2
+ #Subscriptions
3
+
4
+ #Subscriptions allow contacts to control what forms of communications they receive. Contacts can decide whether they want to receive communication pertaining to a specific topic, brand, or an entire HubSpot account.
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 CommunicationPreferences
17
+ class Error
18
+ # A human readable message describing the error along with remediation steps where appropriate
19
+ attr_accessor :message
20
+
21
+ # A unique identifier for the request. Include this value with any error reports or support tickets
22
+ attr_accessor :correlation_id
23
+
24
+ # The error category
25
+ attr_accessor :category
26
+
27
+ # A specific category that contains more specific detail about the error
28
+ attr_accessor :sub_category
29
+
30
+ # further information about the error
31
+ attr_accessor :errors
32
+
33
+ # Context about the error condition
34
+ attr_accessor :context
35
+
36
+ # A map of link names to associated URIs containing documentation about the error or recommended remediation steps
37
+ attr_accessor :links
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'message' => :'message',
43
+ :'correlation_id' => :'correlationId',
44
+ :'category' => :'category',
45
+ :'sub_category' => :'subCategory',
46
+ :'errors' => :'errors',
47
+ :'context' => :'context',
48
+ :'links' => :'links'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'message' => :'String',
56
+ :'correlation_id' => :'String',
57
+ :'category' => :'String',
58
+ :'sub_category' => :'String',
59
+ :'errors' => :'Array<ErrorDetail>',
60
+ :'context' => :'Hash<String, Array<String>>',
61
+ :'links' => :'Hash<String, String>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::CommunicationPreferences::Error` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::CommunicationPreferences::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'message')
87
+ self.message = attributes[:'message']
88
+ end
89
+
90
+ if attributes.key?(:'correlation_id')
91
+ self.correlation_id = attributes[:'correlation_id']
92
+ end
93
+
94
+ if attributes.key?(:'category')
95
+ self.category = attributes[:'category']
96
+ end
97
+
98
+ if attributes.key?(:'sub_category')
99
+ self.sub_category = attributes[:'sub_category']
100
+ end
101
+
102
+ if attributes.key?(:'errors')
103
+ if (value = attributes[:'errors']).is_a?(Array)
104
+ self.errors = value
105
+ end
106
+ end
107
+
108
+ if attributes.key?(:'context')
109
+ if (value = attributes[:'context']).is_a?(Hash)
110
+ self.context = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'links')
115
+ if (value = attributes[:'links']).is_a?(Hash)
116
+ self.links = value
117
+ end
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ if @message.nil?
126
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
127
+ end
128
+
129
+ if @correlation_id.nil?
130
+ invalid_properties.push('invalid value for "correlation_id", correlation_id cannot be nil.')
131
+ end
132
+
133
+ if @category.nil?
134
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
135
+ end
136
+
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ return false if @message.nil?
144
+ return false if @correlation_id.nil?
145
+ return false if @category.nil?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ message == o.message &&
155
+ correlation_id == o.correlation_id &&
156
+ category == o.category &&
157
+ sub_category == o.sub_category &&
158
+ errors == o.errors &&
159
+ context == o.context &&
160
+ links == o.links
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [message, correlation_id, category, sub_category, errors, context, links].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ new.build_from_hash(attributes)
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ self.class.openapi_types.each_pair do |key, type|
188
+ if type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
193
+ end
194
+ elsif !attributes[self.class.attribute_map[key]].nil?
195
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
196
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
197
+ end
198
+
199
+ self
200
+ end
201
+
202
+ # Deserializes the data based on type
203
+ # @param string type Data type
204
+ # @param string value Value to be deserialized
205
+ # @return [Object] Deserialized data
206
+ def _deserialize(type, value)
207
+ case type.to_sym
208
+ when :DateTime
209
+ DateTime.parse(value)
210
+ when :Date
211
+ Date.parse(value)
212
+ when :String
213
+ value.to_s
214
+ when :Integer
215
+ value.to_i
216
+ when :Float
217
+ value.to_f
218
+ when :Boolean
219
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
220
+ true
221
+ else
222
+ false
223
+ end
224
+ when :Object
225
+ # generic object (usually a Hash), return directly
226
+ value
227
+ when /\AArray<(?<inner_type>.+)>\z/
228
+ inner_type = Regexp.last_match[:inner_type]
229
+ value.map { |v| _deserialize(inner_type, v) }
230
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
231
+ k_type = Regexp.last_match[:k_type]
232
+ v_type = Regexp.last_match[:v_type]
233
+ {}.tap do |hash|
234
+ value.each do |k, v|
235
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
236
+ end
237
+ end
238
+ else # model
239
+ Hubspot::CommunicationPreferences.const_get(type).build_from_hash(value)
240
+ end
241
+ end
242
+
243
+ # Returns the string representation of the object
244
+ # @return [String] String presentation of the object
245
+ def to_s
246
+ to_hash.to_s
247
+ end
248
+
249
+ # to_body is an alias to to_hash (backward compatibility)
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_body
252
+ to_hash
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ # Outputs non-array value in the form of hash
272
+ # For object, use to_hash. Otherwise, just return the value
273
+ # @param [Object] value Any valid value
274
+ # @return [Hash] Returns the value in the form of hash
275
+ def _to_hash(value)
276
+ if value.is_a?(Array)
277
+ value.compact.map { |v| _to_hash(v) }
278
+ elsif value.is_a?(Hash)
279
+ {}.tap do |hash|
280
+ value.each { |k, v| hash[k] = _to_hash(v) }
281
+ end
282
+ elsif value.respond_to? :to_hash
283
+ value.to_hash
284
+ else
285
+ value
286
+ end
287
+ end
288
+ end
289
+ end
290
+ end