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