hubspot-api-client 10.0.1 → 11.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +4 -0
  5. data/lib/hubspot/codegen/cms/audit-logs/api/{default_api.rb → audit_logs_api.rb} +3 -3
  6. data/lib/hubspot/codegen/cms/blogs/authors/api/{default_api.rb → author_api.rb} +28 -28
  7. data/lib/hubspot/codegen/cms/blogs/blog-posts/api/{default_api.rb → blog_post_api.rb} +62 -62
  8. data/lib/hubspot/codegen/cms/blogs/tags/api/{default_api.rb → tag_api.rb} +28 -28
  9. data/lib/hubspot/codegen/cms/domains/api/domains_api.rb +2 -2
  10. data/lib/hubspot/codegen/cms/domains/configuration.rb +0 -7
  11. data/lib/hubspot/codegen/cms/hubdb/api/rows_api.rb +102 -102
  12. data/lib/hubspot/codegen/cms/hubdb/api/rows_batch_api.rb +21 -21
  13. data/lib/hubspot/codegen/cms/hubdb/api/tables_api.rb +100 -108
  14. data/lib/hubspot/codegen/cms/hubdb/api_client.rb +1 -1
  15. data/lib/hubspot/codegen/cms/hubdb/api_error.rb +1 -1
  16. data/lib/hubspot/codegen/cms/hubdb/configuration.rb +1 -1
  17. data/lib/hubspot/codegen/cms/hubdb/models/{batch_input_hub_db_table_row_v3.rb → batch_input_hub_db_table_row_v3_request.rb} +5 -5
  18. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_json_node.rb +1 -1
  19. data/lib/hubspot/codegen/cms/hubdb/models/batch_input_string.rb +1 -1
  20. data/lib/hubspot/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors.rb +1 -1
  21. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging.rb +1 -1
  22. data/lib/hubspot/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging.rb +1 -1
  23. data/lib/hubspot/codegen/cms/hubdb/models/column.rb +1 -1
  24. data/lib/hubspot/codegen/cms/hubdb/models/{column_input.rb → column_request.rb} +71 -47
  25. data/lib/hubspot/codegen/cms/hubdb/models/error.rb +1 -1
  26. data/lib/hubspot/codegen/cms/hubdb/models/error_detail.rb +1 -1
  27. data/lib/hubspot/codegen/cms/hubdb/models/foreign_id.rb +1 -1
  28. data/lib/hubspot/codegen/cms/hubdb/models/forward_paging.rb +1 -1
  29. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_clone_request.rb +4 -9
  30. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_row_v3.rb +12 -27
  31. data/lib/hubspot/codegen/cms/hubdb/models/{hub_db_table_row_v3_input.rb → hub_db_table_row_v3_request.rb} +25 -20
  32. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3.rb +1 -1
  33. data/lib/hubspot/codegen/cms/hubdb/models/{hub_db_table_v3_input.rb → hub_db_table_v3_request.rb} +53 -53
  34. data/lib/hubspot/codegen/cms/hubdb/models/import_result.rb +1 -1
  35. data/lib/hubspot/codegen/cms/hubdb/models/next_page.rb +1 -1
  36. data/lib/hubspot/codegen/cms/hubdb/models/option.rb +1 -1
  37. data/lib/hubspot/codegen/cms/hubdb/models/simple_user.rb +1 -1
  38. data/lib/hubspot/codegen/cms/hubdb/models/standard_error.rb +1 -1
  39. data/lib/hubspot/codegen/cms/performance/api/{default_api.rb → public_performance_api.rb} +5 -5
  40. data/lib/hubspot/codegen/cms/site-search/api/{default_api.rb → public_api.rb} +7 -7
  41. data/lib/hubspot/codegen/cms/site-search/models/search_hit_field.rb +15 -15
  42. data/lib/hubspot/codegen/communication_preferences/api/definition_api.rb +80 -0
  43. data/lib/hubspot/codegen/communication_preferences/api/status_api.rb +214 -0
  44. data/lib/hubspot/codegen/communication_preferences/api_client.rb +404 -0
  45. data/lib/hubspot/codegen/communication_preferences/api_error.rb +59 -0
  46. data/lib/hubspot/codegen/communication_preferences/configuration.rb +254 -0
  47. data/lib/hubspot/codegen/communication_preferences/models/error.rb +290 -0
  48. data/lib/hubspot/codegen/communication_preferences/models/error_detail.rb +256 -0
  49. data/lib/hubspot/codegen/communication_preferences/models/public_subscription_status.rb +372 -0
  50. data/lib/hubspot/codegen/communication_preferences/models/public_subscription_statuses_response.rb +231 -0
  51. data/lib/hubspot/codegen/communication_preferences/models/public_update_subscription_status_request.rb +283 -0
  52. data/lib/hubspot/codegen/communication_preferences/models/subscription_definition.rb +339 -0
  53. data/lib/hubspot/codegen/communication_preferences/models/subscription_definitions_response.rb +216 -0
  54. data/lib/hubspot/codegen/crm/companies/api/batch_api.rb +0 -8
  55. data/lib/hubspot/codegen/crm/companies/api/search_api.rb +0 -4
  56. data/lib/hubspot/codegen/crm/companies/models/filter.rb +3 -2
  57. data/lib/hubspot/codegen/crm/contacts/api/batch_api.rb +0 -8
  58. data/lib/hubspot/codegen/crm/contacts/api/gdpr_api.rb +150 -0
  59. data/lib/hubspot/codegen/crm/contacts/api/search_api.rb +0 -4
  60. data/lib/hubspot/codegen/crm/contacts/models/filter.rb +3 -2
  61. data/lib/hubspot/codegen/crm/deals/api/batch_api.rb +0 -8
  62. data/lib/hubspot/codegen/crm/deals/api/search_api.rb +0 -4
  63. data/lib/hubspot/codegen/crm/deals/models/filter.rb +3 -2
  64. data/lib/hubspot/codegen/crm/imports/api/core_api.rb +2 -2
  65. data/lib/hubspot/codegen/crm/imports/api/{default_api.rb → public_imports_api.rb} +8 -8
  66. data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +4 -4
  67. data/lib/hubspot/codegen/crm/line_items/api/batch_api.rb +0 -8
  68. data/lib/hubspot/codegen/crm/line_items/api/search_api.rb +0 -4
  69. data/lib/hubspot/codegen/crm/line_items/models/filter.rb +3 -2
  70. data/lib/hubspot/codegen/crm/objects/api/batch_api.rb +0 -8
  71. data/lib/hubspot/codegen/crm/objects/api/gdpr_api.rb +162 -0
  72. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +0 -4
  73. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +0 -2
  74. data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +0 -4
  75. data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/filter.rb +3 -2
  76. data/lib/hubspot/codegen/crm/objects/models/filter.rb +3 -2
  77. data/lib/hubspot/codegen/crm/owners/api/{default_api.rb → owners_api.rb} +6 -6
  78. data/lib/hubspot/codegen/crm/products/api/batch_api.rb +0 -8
  79. data/lib/hubspot/codegen/crm/products/api/search_api.rb +0 -4
  80. data/lib/hubspot/codegen/crm/products/models/filter.rb +3 -2
  81. data/lib/hubspot/codegen/crm/quotes/api/batch_api.rb +0 -2
  82. data/lib/hubspot/codegen/crm/quotes/api/search_api.rb +0 -4
  83. data/lib/hubspot/codegen/crm/quotes/models/filter.rb +3 -2
  84. data/lib/hubspot/codegen/crm/schemas/api/core_api.rb +3 -3
  85. data/lib/hubspot/codegen/crm/schemas/api/{default_api.rb → public_object_schemas_api.rb} +4 -4
  86. data/lib/hubspot/codegen/crm/tickets/api/batch_api.rb +0 -8
  87. data/lib/hubspot/codegen/crm/tickets/api/search_api.rb +0 -4
  88. data/lib/hubspot/codegen/crm/tickets/models/filter.rb +3 -2
  89. data/lib/hubspot/codegen/crm/timeline/api/templates_api.rb +3 -3
  90. data/lib/hubspot/codegen/crm/timeline/models/{collection_response_timeline_event_template.rb → collection_response_timeline_event_template_no_paging.rb} +7 -17
  91. data/lib/hubspot/codegen/files/files/api/files_api.rb +12 -6
  92. data/lib/hubspot/codegen/files/files/api/folders_api.rb +12 -0
  93. data/lib/hubspot/codegen/files/files/models/collection_response_file.rb +1 -1
  94. data/lib/hubspot/codegen/files/files/models/error_category.rb +18 -18
  95. data/lib/hubspot/codegen/marketing/transactional/api/{default_api.rb → public_smtp_tokens_api.rb} +14 -74
  96. data/lib/hubspot/codegen/marketing/transactional/api/single_send_api.rb +86 -0
  97. data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +82 -0
  98. data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +140 -0
  99. data/lib/hubspot/codegen/oauth/api/tokens_api.rb +100 -0
  100. data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +33 -1
  101. data/lib/hubspot/codegen/oauth/models/token_response_if.rb +27 -4
  102. data/lib/hubspot/version.rb +1 -1
  103. data/lib/hubspot-api-client.rb +16 -3
  104. data/pkg/hubspot-api-client-10.1.1.gem +0 -0
  105. data/spec/codegen/cms/audit-logs/api/{default_api_spec.rb → audit_logs_api_spec.rb} +6 -6
  106. data/spec/codegen/cms/blogs/authors/api/{default_api_spec.rb → author_api_spec.rb} +6 -6
  107. data/spec/codegen/cms/blogs/blog-posts/api/{default_api_spec.rb → blog_post_api_spec.rb} +6 -6
  108. data/spec/codegen/cms/blogs/tags/api/{default_api_spec.rb → tag_api_spec.rb} +6 -6
  109. data/spec/codegen/cms/hubdb/api/rows_api_spec.rb +18 -18
  110. data/spec/codegen/cms/hubdb/api/rows_batch_api_spec.rb +4 -4
  111. data/spec/codegen/cms/hubdb/api/tables_api_spec.rb +35 -36
  112. data/spec/codegen/cms/hubdb/models/{batch_input_hub_db_table_row_v3_spec.rb → batch_input_hub_db_table_row_v3_request_spec.rb} +7 -7
  113. data/spec/codegen/cms/hubdb/models/batch_input_json_node_spec.rb +1 -1
  114. data/spec/codegen/cms/hubdb/models/batch_input_string_spec.rb +1 -1
  115. data/spec/codegen/cms/hubdb/models/batch_response_hub_db_table_row_v3_with_errors_spec.rb +1 -1
  116. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_row_v3_forward_paging_spec.rb +1 -1
  117. data/spec/codegen/cms/hubdb/models/collection_response_with_total_hub_db_table_v3_forward_paging_spec.rb +1 -1
  118. data/spec/codegen/cms/hubdb/models/{column_input_spec.rb → column_request_spec.rb} +14 -22
  119. data/spec/codegen/cms/hubdb/models/column_spec.rb +1 -1
  120. data/spec/codegen/cms/hubdb/models/error_detail_spec.rb +1 -1
  121. data/spec/codegen/cms/hubdb/models/error_spec.rb +1 -1
  122. data/spec/codegen/cms/hubdb/models/foreign_id_spec.rb +1 -1
  123. data/spec/codegen/cms/hubdb/models/forward_paging_spec.rb +1 -1
  124. data/spec/codegen/cms/hubdb/models/hub_db_table_clone_request_spec.rb +1 -1
  125. data/spec/codegen/cms/hubdb/models/{hub_db_table_row_v3_input_spec.rb → hub_db_table_row_v3_request_spec.rb} +10 -10
  126. data/spec/codegen/cms/hubdb/models/hub_db_table_row_v3_spec.rb +7 -1
  127. data/spec/codegen/cms/hubdb/models/{hub_db_table_v3_input_spec.rb → hub_db_table_v3_request_spec.rb} +13 -13
  128. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_spec.rb +1 -1
  129. data/spec/codegen/cms/hubdb/models/import_result_spec.rb +1 -1
  130. data/spec/codegen/cms/hubdb/models/next_page_spec.rb +1 -1
  131. data/spec/codegen/cms/hubdb/models/option_spec.rb +1 -1
  132. data/spec/codegen/cms/hubdb/models/simple_user_spec.rb +1 -1
  133. data/spec/codegen/cms/hubdb/models/standard_error_spec.rb +1 -1
  134. data/spec/codegen/cms/performance/api/{default_api_spec.rb → public_performance_api_spec.rb} +6 -6
  135. data/spec/codegen/cms/site-search/api/{default_api_spec.rb → public_api_spec.rb} +6 -6
  136. data/spec/codegen/cms/site-search/models/search_hit_field_spec.rb +2 -2
  137. data/spec/codegen/communication_preferences/api/definition_api_spec.rb +46 -0
  138. data/spec/codegen/communication_preferences/api/status_api_spec.rb +71 -0
  139. data/spec/codegen/communication_preferences/models/error_detail_spec.rb +65 -0
  140. data/spec/codegen/communication_preferences/models/error_spec.rb +77 -0
  141. data/spec/codegen/communication_preferences/models/public_subscription_status_spec.rb +101 -0
  142. data/spec/codegen/communication_preferences/models/public_subscription_statuses_response_spec.rb +47 -0
  143. data/spec/codegen/communication_preferences/models/public_update_subscription_status_request_spec.rb +63 -0
  144. data/spec/codegen/communication_preferences/models/subscription_definition_spec.rb +95 -0
  145. data/spec/codegen/communication_preferences/models/subscription_definitions_response_spec.rb +41 -0
  146. data/spec/codegen/crm/companies/api/batch_api_spec.rb +0 -4
  147. data/spec/codegen/crm/companies/api/search_api_spec.rb +0 -2
  148. data/spec/codegen/crm/companies/models/filter_spec.rb +1 -1
  149. data/spec/codegen/crm/contacts/api/batch_api_spec.rb +0 -4
  150. data/spec/codegen/crm/contacts/api/gdpr_api_spec.rb +59 -0
  151. data/spec/codegen/crm/contacts/api/search_api_spec.rb +0 -2
  152. data/spec/codegen/crm/contacts/models/filter_spec.rb +1 -1
  153. data/spec/codegen/crm/deals/api/batch_api_spec.rb +0 -4
  154. data/spec/codegen/crm/deals/api/search_api_spec.rb +0 -2
  155. data/spec/codegen/crm/deals/models/filter_spec.rb +1 -1
  156. data/spec/codegen/crm/extensions/calling/api/settings_api_spec.rb +2 -2
  157. data/spec/codegen/crm/extensions/calling/models/settings_patch_request_spec.rb +6 -0
  158. data/spec/codegen/crm/extensions/calling/models/settings_request_spec.rb +6 -0
  159. data/spec/codegen/crm/extensions/calling/models/settings_response_spec.rb +6 -0
  160. data/spec/codegen/crm/extensions/cards/api/cards_api_spec.rb +2 -2
  161. data/spec/codegen/crm/imports/api/{default_api_spec.rb → public_imports_api_spec.rb} +8 -8
  162. data/spec/codegen/crm/imports/models/public_import_error_spec.rb +2 -2
  163. data/spec/codegen/crm/line_items/api/batch_api_spec.rb +0 -4
  164. data/spec/codegen/crm/line_items/api/search_api_spec.rb +0 -2
  165. data/spec/codegen/crm/line_items/models/filter_spec.rb +1 -1
  166. data/spec/codegen/crm/objects/api/batch_api_spec.rb +0 -4
  167. data/spec/codegen/crm/objects/api/gdpr_api_spec.rb +61 -0
  168. data/spec/codegen/crm/objects/api/search_api_spec.rb +0 -2
  169. data/spec/codegen/crm/objects/feedback_submissions/api/batch_api_spec.rb +0 -1
  170. data/spec/codegen/crm/objects/feedback_submissions/api/search_api_spec.rb +0 -2
  171. data/spec/codegen/crm/objects/feedback_submissions/models/filter_spec.rb +1 -1
  172. data/spec/codegen/crm/objects/models/filter_spec.rb +1 -1
  173. data/spec/codegen/crm/owners/api/{default_api_spec.rb → owners_api_spec.rb} +6 -6
  174. data/spec/codegen/crm/products/api/batch_api_spec.rb +0 -4
  175. data/spec/codegen/crm/products/api/search_api_spec.rb +0 -2
  176. data/spec/codegen/crm/products/models/filter_spec.rb +1 -1
  177. data/spec/codegen/crm/quotes/api/batch_api_spec.rb +0 -1
  178. data/spec/codegen/crm/quotes/api/search_api_spec.rb +0 -2
  179. data/spec/codegen/crm/quotes/models/filter_spec.rb +1 -1
  180. data/spec/codegen/crm/schemas/api/{default_api_spec.rb → public_object_schemas_api_spec.rb} +6 -6
  181. data/spec/codegen/crm/tickets/api/batch_api_spec.rb +0 -4
  182. data/spec/codegen/crm/tickets/api/search_api_spec.rb +0 -2
  183. data/spec/codegen/crm/tickets/models/filter_spec.rb +1 -1
  184. data/spec/codegen/crm/timeline/api/templates_api_spec.rb +1 -1
  185. data/spec/codegen/crm/timeline/models/{collection_response_timeline_event_template_spec.rb → collection_response_timeline_event_template_no_paging_spec.rb} +6 -12
  186. data/spec/codegen/files/files/api/files_api_spec.rb +4 -2
  187. data/spec/codegen/files/files/api/folders_api_spec.rb +4 -0
  188. data/spec/codegen/files/files/models/error_category_spec.rb +6 -6
  189. data/spec/codegen/marketing/transactional/api/{default_api_spec.rb → public_smtp_tokens_api_spec.rb} +6 -18
  190. data/spec/codegen/marketing/transactional/api/single_send_api_spec.rb +47 -0
  191. data/spec/codegen/oauth/api/access_tokens_api_spec.rb +45 -0
  192. data/spec/codegen/oauth/api/{default_api_spec.rb → refresh_tokens_api_spec.rb} +6 -31
  193. data/spec/codegen/oauth/api/tokens_api_spec.rb +50 -0
  194. data/spec/codegen/oauth/models/access_token_info_response_spec.rb +12 -0
  195. data/spec/codegen/oauth/models/token_response_if_spec.rb +12 -0
  196. data/spec/features/cms/audit-logs/{default_api_spec.rb → audit_logs_api_spec.rb} +4 -4
  197. data/spec/features/cms/blogs/authors/{default_api_spec.rb → author_api_spec.rb} +28 -28
  198. data/spec/features/cms/blogs/blog-posts/{default_api_spec.rb → blog_post_api_spec.rb} +2 -2
  199. data/spec/features/cms/blogs/tags/{default_api_spec.rb → tag_api_spec.rb} +2 -2
  200. data/spec/features/cms/hubdb/tables_api_spec.rb +1 -1
  201. data/spec/features/cms/perfomance/public_perfomance_api_spec.rb +8 -0
  202. data/spec/features/cms/site-search/{default_api_spec.rb → public_api_spec.rb} +2 -2
  203. data/spec/features/communication_preferences/definition_api_spec.rb +7 -0
  204. data/spec/features/communication_preferences/status_api_spec.rb +9 -0
  205. data/spec/features/crm/contacts/gdpr_api_spec.rb +8 -0
  206. data/spec/features/crm/objects/gdpr_api_spec.rb +8 -0
  207. data/spec/features/crm/owners/{default_api_spec.rb → owners_api_spec.rb} +2 -2
  208. data/spec/features/crm/schemas/public_object_schemas_api_spec.rb +7 -0
  209. data/spec/features/marketing/transactional/{default_api_spec.rb → public_smtp_tokens_api_spec.rb} +2 -3
  210. data/spec/features/marketing/transactional/single_send_api_spec.rb +7 -0
  211. data/spec/features/oauth/access_tokens_api_spec.rb +7 -0
  212. data/spec/features/oauth/refresh_tokens_api_spec.rb +8 -0
  213. data/spec/features/oauth/tokens_api_spec.rb +7 -0
  214. metadata +130 -82
  215. data/lib/hubspot/codegen/cms/hubdb/models/hub_db_table_v3_live_input.rb +0 -241
  216. data/lib/hubspot/codegen/crm/timeline/models/next_page.rb +0 -224
  217. data/lib/hubspot/codegen/crm/timeline/models/paging.rb +0 -219
  218. data/lib/hubspot/codegen/crm/timeline/models/previous_page.rb +0 -224
  219. data/lib/hubspot/codegen/oauth/api/default_api.rb +0 -270
  220. data/spec/codegen/cms/hubdb/models/hub_db_table_v3_live_input_spec.rb +0 -59
  221. data/spec/codegen/crm/timeline/models/next_page_spec.rb +0 -47
  222. data/spec/codegen/crm/timeline/models/paging_spec.rb +0 -47
  223. data/spec/codegen/crm/timeline/models/previous_page_spec.rb +0 -47
  224. data/spec/features/cms/perfomance/default_api_spec.rb +0 -8
  225. data/spec/features/crm/schemas/default_api_spec.rb +0 -7
  226. data/spec/features/oauth/default_api_spec.rb +0 -10
@@ -0,0 +1,256 @@
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 ErrorDetail
18
+ # A human readable message describing the error along with remediation steps where appropriate
19
+ attr_accessor :message
20
+
21
+ # The name of the field or parameter in which the error was found.
22
+ attr_accessor :_in
23
+
24
+ # The status code associated with the error detail
25
+ attr_accessor :code
26
+
27
+ # A specific category that contains more specific detail about the error
28
+ attr_accessor :sub_category
29
+
30
+ # Context about the error condition
31
+ attr_accessor :context
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'message' => :'message',
37
+ :'_in' => :'in',
38
+ :'code' => :'code',
39
+ :'sub_category' => :'subCategory',
40
+ :'context' => :'context'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'message' => :'String',
48
+ :'_in' => :'String',
49
+ :'code' => :'String',
50
+ :'sub_category' => :'String',
51
+ :'context' => :'Hash<String, Array<String>>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::CommunicationPreferences::ErrorDetail` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::CommunicationPreferences::ErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'message')
77
+ self.message = attributes[:'message']
78
+ end
79
+
80
+ if attributes.key?(:'_in')
81
+ self._in = attributes[:'_in']
82
+ end
83
+
84
+ if attributes.key?(:'code')
85
+ self.code = attributes[:'code']
86
+ end
87
+
88
+ if attributes.key?(:'sub_category')
89
+ self.sub_category = attributes[:'sub_category']
90
+ end
91
+
92
+ if attributes.key?(:'context')
93
+ if (value = attributes[:'context']).is_a?(Hash)
94
+ self.context = value
95
+ end
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ if @message.nil?
104
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @message.nil?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ message == o.message &&
123
+ _in == o._in &&
124
+ code == o.code &&
125
+ sub_category == o.sub_category &&
126
+ context == o.context
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [message, _in, code, sub_category, context].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ new.build_from_hash(attributes)
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.openapi_types.each_pair do |key, type|
154
+ if type =~ /\AArray<(.*)>/i
155
+ # check to ensure the input is an array given that the attribute
156
+ # is documented as an array but the input is not
157
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
158
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
159
+ end
160
+ elsif !attributes[self.class.attribute_map[key]].nil?
161
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :DateTime
175
+ DateTime.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ Hubspot::CommunicationPreferences.const_get(type).build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+ end
255
+ end
256
+ end
@@ -0,0 +1,372 @@
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 PublicSubscriptionStatus
18
+ # The ID for the subscription.
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
+ # Whether the contact is subscribed.
28
+ attr_accessor :status
29
+
30
+ # Where the status is determined from e.g. PORTAL_WIDE_STATUS if the contact opted out from the portal.
31
+ attr_accessor :source_of_status
32
+
33
+ # The ID of the brand that the subscription is associated with, if there is one.
34
+ attr_accessor :brand_id
35
+
36
+ # The name of the preferences group that the subscription is associated with.
37
+ attr_accessor :preference_group_name
38
+
39
+ # The legal reason for the current status of the subscription.
40
+ attr_accessor :legal_basis
41
+
42
+ # A more detailed explanation to go with the legal basis.
43
+ attr_accessor :legal_basis_explanation
44
+
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'id' => :'id',
71
+ :'name' => :'name',
72
+ :'description' => :'description',
73
+ :'status' => :'status',
74
+ :'source_of_status' => :'sourceOfStatus',
75
+ :'brand_id' => :'brandId',
76
+ :'preference_group_name' => :'preferenceGroupName',
77
+ :'legal_basis' => :'legalBasis',
78
+ :'legal_basis_explanation' => :'legalBasisExplanation'
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'id' => :'String',
86
+ :'name' => :'String',
87
+ :'description' => :'String',
88
+ :'status' => :'String',
89
+ :'source_of_status' => :'String',
90
+ :'brand_id' => :'Integer',
91
+ :'preference_group_name' => :'String',
92
+ :'legal_basis' => :'String',
93
+ :'legal_basis_explanation' => :'String'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::CommunicationPreferences::PublicSubscriptionStatus` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::CommunicationPreferences::PublicSubscriptionStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'id')
119
+ self.id = attributes[:'id']
120
+ end
121
+
122
+ if attributes.key?(:'name')
123
+ self.name = attributes[:'name']
124
+ end
125
+
126
+ if attributes.key?(:'description')
127
+ self.description = attributes[:'description']
128
+ end
129
+
130
+ if attributes.key?(:'status')
131
+ self.status = attributes[:'status']
132
+ end
133
+
134
+ if attributes.key?(:'source_of_status')
135
+ self.source_of_status = attributes[:'source_of_status']
136
+ end
137
+
138
+ if attributes.key?(:'brand_id')
139
+ self.brand_id = attributes[:'brand_id']
140
+ end
141
+
142
+ if attributes.key?(:'preference_group_name')
143
+ self.preference_group_name = attributes[:'preference_group_name']
144
+ end
145
+
146
+ if attributes.key?(:'legal_basis')
147
+ self.legal_basis = attributes[:'legal_basis']
148
+ end
149
+
150
+ if attributes.key?(:'legal_basis_explanation')
151
+ self.legal_basis_explanation = attributes[:'legal_basis_explanation']
152
+ end
153
+ end
154
+
155
+ # Show invalid properties with the reasons. Usually used together with valid?
156
+ # @return Array for valid properties with the reasons
157
+ def list_invalid_properties
158
+ invalid_properties = Array.new
159
+ if @id.nil?
160
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
161
+ end
162
+
163
+ if @name.nil?
164
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
165
+ end
166
+
167
+ if @description.nil?
168
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
169
+ end
170
+
171
+ if @status.nil?
172
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
173
+ end
174
+
175
+ if @source_of_status.nil?
176
+ invalid_properties.push('invalid value for "source_of_status", source_of_status cannot be nil.')
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ return false if @id.nil?
186
+ return false if @name.nil?
187
+ return false if @description.nil?
188
+ return false if @status.nil?
189
+ status_validator = EnumAttributeValidator.new('String', ["SUBSCRIBED", "NOT_SUBSCRIBED"])
190
+ return false unless status_validator.valid?(@status)
191
+ return false if @source_of_status.nil?
192
+ source_of_status_validator = EnumAttributeValidator.new('String', ["PORTAL_WIDE_STATUS", "BRAND_WIDE_STATUS", "SUBSCRIPTION_STATUS"])
193
+ return false unless source_of_status_validator.valid?(@source_of_status)
194
+ legal_basis_validator = EnumAttributeValidator.new('String', ["LEGITIMATE_INTEREST_PQL", "LEGITIMATE_INTEREST_CLIENT", "PERFORMANCE_OF_CONTRACT", "CONSENT_WITH_NOTICE", "NON_GDPR", "PROCESS_AND_STORE", "LEGITIMATE_INTEREST_OTHER"])
195
+ return false unless legal_basis_validator.valid?(@legal_basis)
196
+ true
197
+ end
198
+
199
+ # Custom attribute writer method checking allowed values (enum).
200
+ # @param [Object] status Object to be assigned
201
+ def status=(status)
202
+ validator = EnumAttributeValidator.new('String', ["SUBSCRIBED", "NOT_SUBSCRIBED"])
203
+ unless validator.valid?(status)
204
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
205
+ end
206
+ @status = status
207
+ end
208
+
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] source_of_status Object to be assigned
211
+ def source_of_status=(source_of_status)
212
+ validator = EnumAttributeValidator.new('String', ["PORTAL_WIDE_STATUS", "BRAND_WIDE_STATUS", "SUBSCRIPTION_STATUS"])
213
+ unless validator.valid?(source_of_status)
214
+ fail ArgumentError, "invalid value for \"source_of_status\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @source_of_status = source_of_status
217
+ end
218
+
219
+ # Custom attribute writer method checking allowed values (enum).
220
+ # @param [Object] legal_basis Object to be assigned
221
+ def legal_basis=(legal_basis)
222
+ validator = EnumAttributeValidator.new('String', ["LEGITIMATE_INTEREST_PQL", "LEGITIMATE_INTEREST_CLIENT", "PERFORMANCE_OF_CONTRACT", "CONSENT_WITH_NOTICE", "NON_GDPR", "PROCESS_AND_STORE", "LEGITIMATE_INTEREST_OTHER"])
223
+ unless validator.valid?(legal_basis)
224
+ fail ArgumentError, "invalid value for \"legal_basis\", must be one of #{validator.allowable_values}."
225
+ end
226
+ @legal_basis = legal_basis
227
+ end
228
+
229
+ # Checks equality by comparing each attribute.
230
+ # @param [Object] Object to be compared
231
+ def ==(o)
232
+ return true if self.equal?(o)
233
+ self.class == o.class &&
234
+ id == o.id &&
235
+ name == o.name &&
236
+ description == o.description &&
237
+ status == o.status &&
238
+ source_of_status == o.source_of_status &&
239
+ brand_id == o.brand_id &&
240
+ preference_group_name == o.preference_group_name &&
241
+ legal_basis == o.legal_basis &&
242
+ legal_basis_explanation == o.legal_basis_explanation
243
+ end
244
+
245
+ # @see the `==` method
246
+ # @param [Object] Object to be compared
247
+ def eql?(o)
248
+ self == o
249
+ end
250
+
251
+ # Calculates hash code according to all attributes.
252
+ # @return [Integer] Hash code
253
+ def hash
254
+ [id, name, description, status, source_of_status, brand_id, preference_group_name, legal_basis, legal_basis_explanation].hash
255
+ end
256
+
257
+ # Builds the object from hash
258
+ # @param [Hash] attributes Model attributes in the form of hash
259
+ # @return [Object] Returns the model itself
260
+ def self.build_from_hash(attributes)
261
+ new.build_from_hash(attributes)
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ self.class.openapi_types.each_pair do |key, type|
270
+ if type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
274
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
275
+ end
276
+ elsif !attributes[self.class.attribute_map[key]].nil?
277
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
278
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
279
+ end
280
+
281
+ self
282
+ end
283
+
284
+ # Deserializes the data based on type
285
+ # @param string type Data type
286
+ # @param string value Value to be deserialized
287
+ # @return [Object] Deserialized data
288
+ def _deserialize(type, value)
289
+ case type.to_sym
290
+ when :DateTime
291
+ DateTime.parse(value)
292
+ when :Date
293
+ Date.parse(value)
294
+ when :String
295
+ value.to_s
296
+ when :Integer
297
+ value.to_i
298
+ when :Float
299
+ value.to_f
300
+ when :Boolean
301
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
302
+ true
303
+ else
304
+ false
305
+ end
306
+ when :Object
307
+ # generic object (usually a Hash), return directly
308
+ value
309
+ when /\AArray<(?<inner_type>.+)>\z/
310
+ inner_type = Regexp.last_match[:inner_type]
311
+ value.map { |v| _deserialize(inner_type, v) }
312
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
313
+ k_type = Regexp.last_match[:k_type]
314
+ v_type = Regexp.last_match[:v_type]
315
+ {}.tap do |hash|
316
+ value.each do |k, v|
317
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
318
+ end
319
+ end
320
+ else # model
321
+ Hubspot::CommunicationPreferences.const_get(type).build_from_hash(value)
322
+ end
323
+ end
324
+
325
+ # Returns the string representation of the object
326
+ # @return [String] String presentation of the object
327
+ def to_s
328
+ to_hash.to_s
329
+ end
330
+
331
+ # to_body is an alias to to_hash (backward compatibility)
332
+ # @return [Hash] Returns the object in the form of hash
333
+ def to_body
334
+ to_hash
335
+ end
336
+
337
+ # Returns the object in the form of hash
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_hash
340
+ hash = {}
341
+ self.class.attribute_map.each_pair do |attr, param|
342
+ value = self.send(attr)
343
+ if value.nil?
344
+ is_nullable = self.class.openapi_nullable.include?(attr)
345
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
346
+ end
347
+
348
+ hash[param] = _to_hash(value)
349
+ end
350
+ hash
351
+ end
352
+
353
+ # Outputs non-array value in the form of hash
354
+ # For object, use to_hash. Otherwise, just return the value
355
+ # @param [Object] value Any valid value
356
+ # @return [Hash] Returns the value in the form of hash
357
+ def _to_hash(value)
358
+ if value.is_a?(Array)
359
+ value.compact.map { |v| _to_hash(v) }
360
+ elsif value.is_a?(Hash)
361
+ {}.tap do |hash|
362
+ value.each { |k, v| hash[k] = _to_hash(v) }
363
+ end
364
+ elsif value.respond_to? :to_hash
365
+ value.to_hash
366
+ else
367
+ value
368
+ end
369
+ end
370
+ end
371
+ end
372
+ end