hubspot-api-client 17.0.0.pre.beta.2 → 17.0.0.pre.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/hubspot/codegen/crm/associations/schema/api/types_api.rb +97 -0
  5. data/lib/hubspot/codegen/crm/associations/schema/api_client.rb +412 -0
  6. data/lib/hubspot/codegen/crm/associations/schema/api_error.rb +63 -0
  7. data/lib/hubspot/codegen/crm/associations/schema/configuration.rb +296 -0
  8. data/lib/hubspot/codegen/crm/associations/schema/models/associated_id.rb +244 -0
  9. data/lib/hubspot/codegen/crm/associations/schema/models/batch_input_public_association.rb +232 -0
  10. data/lib/hubspot/codegen/crm/associations/schema/models/batch_input_public_object_id.rb +232 -0
  11. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association.rb +328 -0
  12. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association_multi.rb +328 -0
  13. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association_multi_with_errors.rb +348 -0
  14. data/lib/hubspot/codegen/crm/associations/schema/models/batch_response_public_association_with_errors.rb +348 -0
  15. data/lib/hubspot/codegen/crm/associations/schema/models/collection_response_public_association_definition_no_paging.rb +232 -0
  16. data/lib/hubspot/codegen/crm/associations/schema/models/error.rb +307 -0
  17. data/lib/hubspot/codegen/crm/associations/schema/models/error_category.rb +278 -0
  18. data/lib/hubspot/codegen/crm/associations/schema/models/error_detail.rb +273 -0
  19. data/lib/hubspot/codegen/crm/associations/schema/models/next_page.rb +239 -0
  20. data/lib/hubspot/codegen/crm/associations/schema/models/paging.rb +234 -0
  21. data/lib/hubspot/codegen/crm/associations/schema/models/previous_page.rb +239 -0
  22. data/lib/hubspot/codegen/crm/associations/schema/models/public_association.rb +258 -0
  23. data/lib/hubspot/codegen/crm/associations/schema/models/public_association_definition.rb +244 -0
  24. data/lib/hubspot/codegen/crm/associations/schema/models/public_association_multi.rb +256 -0
  25. data/lib/hubspot/codegen/crm/associations/schema/models/public_object_id.rb +231 -0
  26. data/lib/hubspot/codegen/crm/associations/schema/models/standard_error.rb +324 -0
  27. data/lib/hubspot/codegen/crm/associations/v4/api/basic_api.rb +365 -0
  28. data/lib/hubspot/codegen/crm/associations/v4/api/batch_api.rb +1 -1
  29. data/lib/hubspot/codegen/crm/associations/v4/api_client.rb +1 -1
  30. data/lib/hubspot/codegen/crm/associations/v4/api_error.rb +1 -1
  31. data/lib/hubspot/codegen/crm/associations/v4/configuration.rb +1 -1
  32. data/lib/hubspot/codegen/crm/associations/v4/models/associated_id.rb +244 -0
  33. data/lib/hubspot/codegen/crm/associations/v4/models/association_spec.rb +1 -1
  34. data/lib/hubspot/codegen/crm/associations/v4/models/association_spec_with_label.rb +1 -1
  35. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_archive.rb +1 -1
  36. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_post.rb +1 -1
  37. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_default_association_multi_post.rb +1 -1
  38. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_fetch_associations_batch_request.rb +1 -1
  39. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_simple_public_object_batch_input.rb +232 -0
  40. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_simple_public_object_id.rb +232 -0
  41. data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_simple_public_object_input_for_create.rb +232 -0
  42. data/lib/hubspot/codegen/crm/associations/v4/models/batch_read_input_simple_public_object_id.rb +273 -0
  43. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair.rb +1 -1
  44. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair_with_errors.rb +1 -1
  45. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label.rb +1 -1
  46. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label_with_errors.rb +1 -1
  47. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_default_association.rb +1 -1
  48. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_simple_public_object.rb +328 -0
  49. data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_simple_public_object_with_errors.rb +348 -0
  50. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_associated_id.rb +241 -0
  51. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_association_spec_with_label_no_paging.rb +1 -1
  52. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_multi_associated_object_with_label_forward_paging.rb +241 -0
  53. data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_simple_public_object_with_associations_forward_paging.rb +241 -0
  54. data/lib/hubspot/codegen/crm/associations/v4/models/error.rb +1 -1
  55. data/lib/hubspot/codegen/crm/associations/v4/models/error_category.rb +1 -1
  56. data/lib/hubspot/codegen/crm/associations/v4/models/error_detail.rb +1 -1
  57. data/lib/hubspot/codegen/crm/associations/v4/models/forward_paging.rb +225 -0
  58. data/lib/hubspot/codegen/crm/associations/v4/models/labels_between_object_pair.rb +1 -1
  59. data/lib/hubspot/codegen/crm/associations/v4/models/multi_associated_object_with_label.rb +1 -1
  60. data/lib/hubspot/codegen/crm/associations/v4/models/next_page.rb +1 -1
  61. data/lib/hubspot/codegen/crm/associations/v4/models/paging.rb +1 -1
  62. data/lib/hubspot/codegen/crm/associations/v4/models/previous_page.rb +1 -1
  63. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_create_request.rb +1 -1
  64. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_update_request.rb +1 -1
  65. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_archive.rb +1 -1
  66. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_post.rb +1 -1
  67. data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_with_label.rb +1 -1
  68. data/lib/hubspot/codegen/crm/associations/v4/models/public_associations_for_object.rb +246 -0
  69. data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association.rb +1 -1
  70. data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association_multi_post.rb +1 -1
  71. data/lib/hubspot/codegen/crm/associations/v4/models/public_fetch_associations_batch_request.rb +1 -1
  72. data/lib/hubspot/codegen/crm/associations/v4/models/public_gdpr_delete_input.rb +239 -0
  73. data/lib/hubspot/codegen/crm/associations/v4/models/public_object_id.rb +1 -1
  74. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object.rb +303 -0
  75. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_batch_input.rb +246 -0
  76. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_id.rb +230 -0
  77. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_input.rb +232 -0
  78. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_input_for_create.rb +248 -0
  79. data/lib/hubspot/codegen/crm/associations/v4/models/simple_public_object_with_associations.rb +314 -0
  80. data/lib/hubspot/codegen/crm/associations/v4/models/standard_error.rb +1 -1
  81. data/lib/hubspot/codegen/crm/associations/v4/models/value_with_timestamp.rb +285 -0
  82. data/lib/hubspot/codegen/crm/associations/v4/schema/api/definitions_api.rb +334 -0
  83. data/lib/hubspot/codegen/crm/associations/v4/schema/api_client.rb +414 -0
  84. data/lib/hubspot/codegen/crm/associations/v4/schema/api_error.rb +65 -0
  85. data/lib/hubspot/codegen/crm/associations/v4/schema/configuration.rb +298 -0
  86. data/lib/hubspot/codegen/crm/associations/v4/schema/models/association_spec.rb +280 -0
  87. data/lib/hubspot/codegen/crm/associations/v4/schema/models/association_spec_with_label.rb +289 -0
  88. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_association_multi_archive.rb +234 -0
  89. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_association_multi_post.rb +234 -0
  90. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_default_association_multi_post.rb +234 -0
  91. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_input_public_fetch_associations_batch_request.rb +234 -0
  92. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_labels_between_object_pair.rb +330 -0
  93. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_labels_between_object_pair_with_errors.rb +350 -0
  94. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_public_association_multi_with_label.rb +330 -0
  95. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_public_association_multi_with_label_with_errors.rb +350 -0
  96. data/lib/hubspot/codegen/crm/associations/v4/schema/models/batch_response_public_default_association.rb +350 -0
  97. data/lib/hubspot/codegen/crm/associations/v4/schema/models/collection_response_association_spec_with_label_no_paging.rb +234 -0
  98. data/lib/hubspot/codegen/crm/associations/v4/schema/models/error.rb +309 -0
  99. data/lib/hubspot/codegen/crm/associations/v4/schema/models/error_category.rb +280 -0
  100. data/lib/hubspot/codegen/crm/associations/v4/schema/models/error_detail.rb +275 -0
  101. data/lib/hubspot/codegen/crm/associations/v4/schema/models/labels_between_object_pair.rb +290 -0
  102. data/lib/hubspot/codegen/crm/associations/v4/schema/models/multi_associated_object_with_label.rb +248 -0
  103. data/lib/hubspot/codegen/crm/associations/v4/schema/models/next_page.rb +241 -0
  104. data/lib/hubspot/codegen/crm/associations/v4/schema/models/paging.rb +236 -0
  105. data/lib/hubspot/codegen/crm/associations/v4/schema/models/previous_page.rb +241 -0
  106. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_definition_create_request.rb +246 -0
  107. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_definition_update_request.rb +246 -0
  108. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_multi_archive.rb +248 -0
  109. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_multi_post.rb +262 -0
  110. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_association_multi_with_label.rb +257 -0
  111. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_default_association.rb +260 -0
  112. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_default_association_multi_post.rb +246 -0
  113. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_fetch_associations_batch_request.rb +241 -0
  114. data/lib/hubspot/codegen/crm/associations/v4/schema/models/public_object_id.rb +232 -0
  115. data/lib/hubspot/codegen/crm/associations/v4/schema/models/standard_error.rb +326 -0
  116. data/lib/hubspot/codegen/crm/objects/communications/api/basic_api.rb +391 -0
  117. data/lib/hubspot/codegen/crm/objects/communications/api/batch_api.rb +295 -0
  118. data/lib/hubspot/codegen/crm/objects/communications/api/public_object_api.rb +94 -0
  119. data/lib/hubspot/codegen/crm/objects/communications/api/search_api.rb +92 -0
  120. data/lib/hubspot/codegen/crm/objects/communications/api_client.rb +412 -0
  121. data/lib/hubspot/codegen/crm/objects/communications/api_error.rb +63 -0
  122. data/lib/hubspot/codegen/crm/objects/communications/configuration.rb +296 -0
  123. data/lib/hubspot/codegen/crm/objects/communications/models/associated_id.rb +244 -0
  124. data/lib/hubspot/codegen/crm/objects/communications/models/association_spec.rb +278 -0
  125. data/lib/hubspot/codegen/crm/objects/communications/models/batch_input_simple_public_object_batch_input.rb +232 -0
  126. data/lib/hubspot/codegen/crm/objects/communications/models/batch_input_simple_public_object_id.rb +232 -0
  127. data/lib/hubspot/codegen/crm/objects/communications/models/batch_input_simple_public_object_input_for_create.rb +232 -0
  128. data/lib/hubspot/codegen/crm/objects/communications/models/batch_read_input_simple_public_object_id.rb +273 -0
  129. data/lib/hubspot/codegen/crm/objects/communications/models/batch_response_simple_public_object.rb +328 -0
  130. data/lib/hubspot/codegen/crm/objects/communications/models/batch_response_simple_public_object_with_errors.rb +348 -0
  131. data/lib/hubspot/codegen/crm/objects/communications/models/collection_response_associated_id.rb +241 -0
  132. data/lib/hubspot/codegen/crm/objects/communications/models/collection_response_simple_public_object_with_associations_forward_paging.rb +241 -0
  133. data/lib/hubspot/codegen/crm/objects/communications/models/collection_response_with_total_simple_public_object_forward_paging.rb +255 -0
  134. data/lib/hubspot/codegen/crm/objects/communications/models/error.rb +307 -0
  135. data/lib/hubspot/codegen/crm/objects/communications/models/error_category.rb +278 -0
  136. data/lib/hubspot/codegen/crm/objects/communications/models/error_detail.rb +273 -0
  137. data/lib/hubspot/codegen/crm/objects/communications/models/filter.rb +308 -0
  138. data/lib/hubspot/codegen/crm/objects/communications/models/filter_group.rb +232 -0
  139. data/lib/hubspot/codegen/crm/objects/communications/models/forward_paging.rb +225 -0
  140. data/lib/hubspot/codegen/crm/objects/communications/models/next_page.rb +239 -0
  141. data/lib/hubspot/codegen/crm/objects/communications/models/paging.rb +234 -0
  142. data/lib/hubspot/codegen/crm/objects/communications/models/previous_page.rb +239 -0
  143. data/lib/hubspot/codegen/crm/objects/communications/models/public_associations_for_object.rb +246 -0
  144. data/lib/hubspot/codegen/crm/objects/communications/models/public_merge_input.rb +244 -0
  145. data/lib/hubspot/codegen/crm/objects/communications/models/public_object_id.rb +230 -0
  146. data/lib/hubspot/codegen/crm/objects/communications/models/public_object_search_request.rb +301 -0
  147. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object.rb +303 -0
  148. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_batch_input.rb +246 -0
  149. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_id.rb +230 -0
  150. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_input.rb +232 -0
  151. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_input_for_create.rb +248 -0
  152. data/lib/hubspot/codegen/crm/objects/communications/models/simple_public_object_with_associations.rb +314 -0
  153. data/lib/hubspot/codegen/crm/objects/communications/models/standard_error.rb +324 -0
  154. data/lib/hubspot/codegen/crm/objects/communications/models/value_with_timestamp.rb +285 -0
  155. data/lib/hubspot/discovery/crm/associations/client.rb +4 -2
  156. data/lib/hubspot/discovery/crm/associations/schema/api/types_api.rb +15 -0
  157. data/lib/hubspot/discovery/crm/associations/schema/client.rb +20 -0
  158. data/lib/hubspot/discovery/crm/associations/v4/api/{definitions_api.rb → basic_api.rb} +1 -1
  159. data/lib/hubspot/discovery/crm/associations/v4/client.rb +6 -1
  160. data/lib/hubspot/discovery/crm/associations/v4/schema/api/definitions_api.rb +17 -0
  161. data/lib/hubspot/discovery/crm/associations/v4/schema/client.rb +22 -0
  162. data/lib/hubspot/discovery/crm/objects/client.rb +1 -0
  163. data/lib/hubspot/discovery/crm/objects/communications/api/basic_api.rb +15 -0
  164. data/lib/hubspot/discovery/crm/objects/communications/api/batch_api.rb +15 -0
  165. data/lib/hubspot/discovery/crm/objects/communications/api/public_object_api.rb +15 -0
  166. data/lib/hubspot/discovery/crm/objects/communications/api/search_api.rb +15 -0
  167. data/lib/hubspot/discovery/crm/objects/communications/client.rb +24 -0
  168. data/lib/hubspot/exceptions.rb +9 -7
  169. data/lib/hubspot/helpers/association_type.rb +92 -0
  170. data/lib/hubspot/helpers/signature.rb +2 -2
  171. data/lib/hubspot/version.rb +1 -1
  172. data/spec/discovery/crm/associations/client_spec.rb +1 -0
  173. data/spec/discovery/crm/associations/schema/types_api_spec.rb +7 -0
  174. data/spec/discovery/crm/associations/v4/basic_api_spec.rb +10 -0
  175. data/spec/discovery/crm/associations/v4/client_spec.rb +7 -0
  176. data/spec/discovery/crm/associations/v4/{definitions_api_spec.rb → schema/definitions_api_spec.rb} +3 -3
  177. data/spec/discovery/crm/objects/client_spec.rb +1 -0
  178. data/spec/discovery/crm/objects/communications/basic_api_spec.rb +10 -0
  179. data/spec/discovery/crm/objects/communications/batch_api_spec.rb +10 -0
  180. data/spec/discovery/crm/objects/communications/public_object_api_spec.rb +7 -0
  181. data/spec/discovery/crm/objects/communications/search_api_spec.rb +7 -0
  182. data/spec/helpers/signature_spec.rb +4 -3
  183. metadata +146 -11
  184. data/lib/hubspot/codegen/crm/associations/api/types_api.rb +0 -95
  185. data/lib/hubspot/codegen/crm/associations/v4/api/definitions_api.rb +0 -332
  186. data/lib/hubspot/discovery/crm/associations/api/types_api.rb +0 -13
  187. data/lib/hubspot/helpers/webhooks_helper.rb +0 -32
  188. data/spec/discovery/crm/associations/types_api_spec.rb +0 -7
@@ -0,0 +1,324 @@
1
+ =begin
2
+ #Associations
3
+
4
+ #Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations.
5
+
6
+ The version of the OpenAPI document: v3
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Hubspot
17
+ module Crm
18
+ module Associations
19
+ module Schema
20
+ class StandardError
21
+ attr_accessor :status
22
+
23
+ attr_accessor :id
24
+
25
+ attr_accessor :category
26
+
27
+ attr_accessor :sub_category
28
+
29
+ attr_accessor :message
30
+
31
+ attr_accessor :errors
32
+
33
+ attr_accessor :context
34
+
35
+ attr_accessor :links
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'status' => :'status',
41
+ :'id' => :'id',
42
+ :'category' => :'category',
43
+ :'sub_category' => :'subCategory',
44
+ :'message' => :'message',
45
+ :'errors' => :'errors',
46
+ :'context' => :'context',
47
+ :'links' => :'links'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'status' => :'String',
60
+ :'id' => :'String',
61
+ :'category' => :'ErrorCategory',
62
+ :'sub_category' => :'Object',
63
+ :'message' => :'String',
64
+ :'errors' => :'Array<ErrorDetail>',
65
+ :'context' => :'Hash<String, Array<String>>',
66
+ :'links' => :'Hash<String, String>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Associations::Schema::StandardError` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Associations::Schema::StandardError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'status')
92
+ self.status = attributes[:'status']
93
+ end
94
+
95
+ if attributes.key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.key?(:'category')
100
+ self.category = attributes[:'category']
101
+ end
102
+
103
+ if attributes.key?(:'sub_category')
104
+ self.sub_category = attributes[:'sub_category']
105
+ end
106
+
107
+ if attributes.key?(:'message')
108
+ self.message = attributes[:'message']
109
+ end
110
+
111
+ if attributes.key?(:'errors')
112
+ if (value = attributes[:'errors']).is_a?(Array)
113
+ self.errors = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'context')
118
+ if (value = attributes[:'context']).is_a?(Hash)
119
+ self.context = value
120
+ end
121
+ end
122
+
123
+ if attributes.key?(:'links')
124
+ if (value = attributes[:'links']).is_a?(Hash)
125
+ self.links = value
126
+ end
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ invalid_properties = Array.new
134
+ if @status.nil?
135
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
136
+ end
137
+
138
+ if @category.nil?
139
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
140
+ end
141
+
142
+ if @message.nil?
143
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
144
+ end
145
+
146
+ if @errors.nil?
147
+ invalid_properties.push('invalid value for "errors", errors cannot be nil.')
148
+ end
149
+
150
+ if @context.nil?
151
+ invalid_properties.push('invalid value for "context", context cannot be nil.')
152
+ end
153
+
154
+ if @links.nil?
155
+ invalid_properties.push('invalid value for "links", links cannot be nil.')
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ return false if @status.nil?
165
+ return false if @category.nil?
166
+ return false if @message.nil?
167
+ return false if @errors.nil?
168
+ return false if @context.nil?
169
+ return false if @links.nil?
170
+ true
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ status == o.status &&
179
+ id == o.id &&
180
+ category == o.category &&
181
+ sub_category == o.sub_category &&
182
+ message == o.message &&
183
+ errors == o.errors &&
184
+ context == o.context &&
185
+ links == o.links
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Integer] Hash code
196
+ def hash
197
+ [status, id, category, sub_category, message, errors, context, links].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def self.build_from_hash(attributes)
204
+ new.build_from_hash(attributes)
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def build_from_hash(attributes)
211
+ return nil unless attributes.is_a?(Hash)
212
+ attributes = attributes.transform_keys(&:to_sym)
213
+ self.class.openapi_types.each_pair do |key, type|
214
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
215
+ self.send("#{key}=", nil)
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
220
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
221
+ end
222
+ elsif !attributes[self.class.attribute_map[key]].nil?
223
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
224
+ end
225
+ end
226
+
227
+ self
228
+ end
229
+
230
+ # Deserializes the data based on type
231
+ # @param string type Data type
232
+ # @param string value Value to be deserialized
233
+ # @return [Object] Deserialized data
234
+ def _deserialize(type, value)
235
+ case type.to_sym
236
+ when :Time
237
+ Time.parse(value)
238
+ when :Date
239
+ Date.parse(value)
240
+ when :String
241
+ value.to_s
242
+ when :Integer
243
+ value.to_i
244
+ when :Float
245
+ value.to_f
246
+ when :Boolean
247
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
248
+ true
249
+ else
250
+ false
251
+ end
252
+ when :Object
253
+ # generic object (usually a Hash), return directly
254
+ value
255
+ when /\AArray<(?<inner_type>.+)>\z/
256
+ inner_type = Regexp.last_match[:inner_type]
257
+ value.map { |v| _deserialize(inner_type, v) }
258
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
259
+ k_type = Regexp.last_match[:k_type]
260
+ v_type = Regexp.last_match[:v_type]
261
+ {}.tap do |hash|
262
+ value.each do |k, v|
263
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
264
+ end
265
+ end
266
+ else # model
267
+ # models (e.g. Pet) or oneOf
268
+ klass = Hubspot::Crm::Associations::Schema.const_get(type)
269
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
270
+ end
271
+ end
272
+
273
+ # Returns the string representation of the object
274
+ # @return [String] String presentation of the object
275
+ def to_s
276
+ to_hash.to_s
277
+ end
278
+
279
+ # to_body is an alias to to_hash (backward compatibility)
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_body
282
+ to_hash
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ if value.nil?
292
+ is_nullable = self.class.openapi_nullable.include?(attr)
293
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
294
+ end
295
+
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ # Outputs non-array value in the form of hash
302
+ # For object, use to_hash. Otherwise, just return the value
303
+ # @param [Object] value Any valid value
304
+ # @return [Hash] Returns the value in the form of hash
305
+ def _to_hash(value)
306
+ if value.is_a?(Array)
307
+ value.compact.map { |v| _to_hash(v) }
308
+ elsif value.is_a?(Hash)
309
+ {}.tap do |hash|
310
+ value.each { |k, v| hash[k] = _to_hash(v) }
311
+ end
312
+ elsif value.respond_to? :to_hash
313
+ value.to_hash
314
+ else
315
+ value
316
+ end
317
+ end
318
+
319
+ end
320
+
321
+ end
322
+ end
323
+ end
324
+ end
@@ -0,0 +1,365 @@
1
+ =begin
2
+ #CrmPublicObjectsService
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Hubspot
16
+ module Crm
17
+ module Associations
18
+ module V4
19
+ class BasicApi
20
+ include Hubspot::Helpers::GetAllHelper
21
+
22
+ attr_accessor :api_client
23
+
24
+ def initialize(api_client = ApiClient.default)
25
+ @api_client = api_client
26
+ end
27
+ # Delete
28
+ # deletes all associations between two records.
29
+ # @param object_type [String]
30
+ # @param object_id [Integer]
31
+ # @param to_object_type [String]
32
+ # @param to_object_id [Integer]
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [nil]
35
+ def archive(object_type, object_id, to_object_type, to_object_id, opts = {})
36
+ archive_with_http_info(object_type, object_id, to_object_type, to_object_id, opts)
37
+ nil
38
+ end
39
+
40
+ # Delete
41
+ # deletes all associations between two records.
42
+ # @param object_type [String]
43
+ # @param object_id [Integer]
44
+ # @param to_object_type [String]
45
+ # @param to_object_id [Integer]
46
+ # @param [Hash] opts the optional parameters
47
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
48
+ def archive_with_http_info(object_type, object_id, to_object_type, to_object_id, opts = {})
49
+ if @api_client.config.debugging
50
+ @api_client.config.logger.debug 'Calling API: BasicApi.archive ...'
51
+ end
52
+ # verify the required parameter 'object_type' is set
53
+ if @api_client.config.client_side_validation && object_type.nil?
54
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.archive"
55
+ end
56
+ # verify the required parameter 'object_id' is set
57
+ if @api_client.config.client_side_validation && object_id.nil?
58
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling BasicApi.archive"
59
+ end
60
+ # verify the required parameter 'to_object_type' is set
61
+ if @api_client.config.client_side_validation && to_object_type.nil?
62
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BasicApi.archive"
63
+ end
64
+ # verify the required parameter 'to_object_id' is set
65
+ if @api_client.config.client_side_validation && to_object_id.nil?
66
+ fail ArgumentError, "Missing the required parameter 'to_object_id' when calling BasicApi.archive"
67
+ end
68
+ # resource path
69
+ local_var_path = '/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
70
+
71
+ # query parameters
72
+ query_params = opts[:query_params] || {}
73
+
74
+ # header parameters
75
+ header_params = opts[:header_params] || {}
76
+ # HTTP header 'Accept' (if needed)
77
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
78
+
79
+ # form parameters
80
+ form_params = opts[:form_params] || {}
81
+
82
+ # http body (model)
83
+ post_body = opts[:debug_body]
84
+
85
+ # return_type
86
+ return_type = opts[:debug_return_type]
87
+
88
+ # auth_names
89
+ auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
90
+
91
+ new_options = opts.merge(
92
+ :operation => :"BasicApi.archive",
93
+ :header_params => header_params,
94
+ :query_params => query_params,
95
+ :form_params => form_params,
96
+ :body => post_body,
97
+ :auth_names => auth_names,
98
+ :return_type => return_type
99
+ )
100
+
101
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug "API called: BasicApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
+ end
105
+ return data, status_code, headers
106
+ end
107
+
108
+ # Create
109
+ # Set association labels between two records.
110
+ # @param object_type [String]
111
+ # @param object_id [Integer]
112
+ # @param to_object_type [String]
113
+ # @param to_object_id [Integer]
114
+ # @param association_spec [Array<AssociationSpec>]
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [LabelsBetweenObjectPair]
117
+ def create(object_type, object_id, to_object_type, to_object_id, association_spec, opts = {})
118
+ data, _status_code, _headers = create_with_http_info(object_type, object_id, to_object_type, to_object_id, association_spec, opts)
119
+ data
120
+ end
121
+
122
+ # Create
123
+ # Set association labels between two records.
124
+ # @param object_type [String]
125
+ # @param object_id [Integer]
126
+ # @param to_object_type [String]
127
+ # @param to_object_id [Integer]
128
+ # @param association_spec [Array<AssociationSpec>]
129
+ # @param [Hash] opts the optional parameters
130
+ # @return [Array<(LabelsBetweenObjectPair, Integer, Hash)>] LabelsBetweenObjectPair data, response status code and response headers
131
+ def create_with_http_info(object_type, object_id, to_object_type, to_object_id, association_spec, opts = {})
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug 'Calling API: BasicApi.create ...'
134
+ end
135
+ # verify the required parameter 'object_type' is set
136
+ if @api_client.config.client_side_validation && object_type.nil?
137
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.create"
138
+ end
139
+ # verify the required parameter 'object_id' is set
140
+ if @api_client.config.client_side_validation && object_id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling BasicApi.create"
142
+ end
143
+ # verify the required parameter 'to_object_type' is set
144
+ if @api_client.config.client_side_validation && to_object_type.nil?
145
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BasicApi.create"
146
+ end
147
+ # verify the required parameter 'to_object_id' is set
148
+ if @api_client.config.client_side_validation && to_object_id.nil?
149
+ fail ArgumentError, "Missing the required parameter 'to_object_id' when calling BasicApi.create"
150
+ end
151
+ # verify the required parameter 'association_spec' is set
152
+ if @api_client.config.client_side_validation && association_spec.nil?
153
+ fail ArgumentError, "Missing the required parameter 'association_spec' when calling BasicApi.create"
154
+ end
155
+ # resource path
156
+ local_var_path = '/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
157
+
158
+ # query parameters
159
+ query_params = opts[:query_params] || {}
160
+
161
+ # header parameters
162
+ header_params = opts[:header_params] || {}
163
+ # HTTP header 'Accept' (if needed)
164
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
165
+ # HTTP header 'Content-Type'
166
+ content_type = @api_client.select_header_content_type(['application/json'])
167
+ if !content_type.nil?
168
+ header_params['Content-Type'] = content_type
169
+ end
170
+
171
+ # form parameters
172
+ form_params = opts[:form_params] || {}
173
+
174
+ # http body (model)
175
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(association_spec)
176
+
177
+ # return_type
178
+ return_type = opts[:debug_return_type] || 'LabelsBetweenObjectPair'
179
+
180
+ # auth_names
181
+ auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
182
+
183
+ new_options = opts.merge(
184
+ :operation => :"BasicApi.create",
185
+ :header_params => header_params,
186
+ :query_params => query_params,
187
+ :form_params => form_params,
188
+ :body => post_body,
189
+ :auth_names => auth_names,
190
+ :return_type => return_type
191
+ )
192
+
193
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
194
+ if @api_client.config.debugging
195
+ @api_client.config.logger.debug "API called: BasicApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
196
+ end
197
+ return data, status_code, headers
198
+ end
199
+
200
+ # Create Default
201
+ # Create the default (most generic) association type between two object types
202
+ # @param from_object_type [String]
203
+ # @param from_object_id [Integer]
204
+ # @param to_object_type [String]
205
+ # @param to_object_id [Integer]
206
+ # @param [Hash] opts the optional parameters
207
+ # @return [BatchResponsePublicDefaultAssociation]
208
+ def create_default(from_object_type, from_object_id, to_object_type, to_object_id, opts = {})
209
+ data, _status_code, _headers = create_default_with_http_info(from_object_type, from_object_id, to_object_type, to_object_id, opts)
210
+ data
211
+ end
212
+
213
+ # Create Default
214
+ # Create the default (most generic) association type between two object types
215
+ # @param from_object_type [String]
216
+ # @param from_object_id [Integer]
217
+ # @param to_object_type [String]
218
+ # @param to_object_id [Integer]
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [Array<(BatchResponsePublicDefaultAssociation, Integer, Hash)>] BatchResponsePublicDefaultAssociation data, response status code and response headers
221
+ def create_default_with_http_info(from_object_type, from_object_id, to_object_type, to_object_id, opts = {})
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug 'Calling API: BasicApi.create_default ...'
224
+ end
225
+ # verify the required parameter 'from_object_type' is set
226
+ if @api_client.config.client_side_validation && from_object_type.nil?
227
+ fail ArgumentError, "Missing the required parameter 'from_object_type' when calling BasicApi.create_default"
228
+ end
229
+ # verify the required parameter 'from_object_id' is set
230
+ if @api_client.config.client_side_validation && from_object_id.nil?
231
+ fail ArgumentError, "Missing the required parameter 'from_object_id' when calling BasicApi.create_default"
232
+ end
233
+ # verify the required parameter 'to_object_type' is set
234
+ if @api_client.config.client_side_validation && to_object_type.nil?
235
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BasicApi.create_default"
236
+ end
237
+ # verify the required parameter 'to_object_id' is set
238
+ if @api_client.config.client_side_validation && to_object_id.nil?
239
+ fail ArgumentError, "Missing the required parameter 'to_object_id' when calling BasicApi.create_default"
240
+ end
241
+ # resource path
242
+ local_var_path = '/crm/v4/objects/{fromObjectType}/{fromObjectId}/associations/default/{toObjectType}/{toObjectId}'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'fromObjectId' + '}', CGI.escape(from_object_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
243
+
244
+ # query parameters
245
+ query_params = opts[:query_params] || {}
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
251
+
252
+ # form parameters
253
+ form_params = opts[:form_params] || {}
254
+
255
+ # http body (model)
256
+ post_body = opts[:debug_body]
257
+
258
+ # return_type
259
+ return_type = opts[:debug_return_type] || 'BatchResponsePublicDefaultAssociation'
260
+
261
+ # auth_names
262
+ auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
263
+
264
+ new_options = opts.merge(
265
+ :operation => :"BasicApi.create_default",
266
+ :header_params => header_params,
267
+ :query_params => query_params,
268
+ :form_params => form_params,
269
+ :body => post_body,
270
+ :auth_names => auth_names,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: BasicApi#create_default\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
281
+ # List
282
+ # List all associations of an object by object type. Limit 1000 per call.
283
+ # @param object_type [String]
284
+ # @param object_id [Integer]
285
+ # @param to_object_type [String]
286
+ # @param [Hash] opts the optional parameters
287
+ # @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
288
+ # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
289
+ # @return [CollectionResponseMultiAssociatedObjectWithLabelForwardPaging]
290
+ def get_page(object_type, object_id, to_object_type, opts = {})
291
+ data, _status_code, _headers = get_page_with_http_info(object_type, object_id, to_object_type, opts)
292
+ data
293
+ end
294
+
295
+ # List
296
+ # List all associations of an object by object type. Limit 1000 per call.
297
+ # @param object_type [String]
298
+ # @param object_id [Integer]
299
+ # @param to_object_type [String]
300
+ # @param [Hash] opts the optional parameters
301
+ # @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
302
+ # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
303
+ # @return [Array<(CollectionResponseMultiAssociatedObjectWithLabelForwardPaging, Integer, Hash)>] CollectionResponseMultiAssociatedObjectWithLabelForwardPaging data, response status code and response headers
304
+ def get_page_with_http_info(object_type, object_id, to_object_type, opts = {})
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug 'Calling API: BasicApi.get_page ...'
307
+ end
308
+ # verify the required parameter 'object_type' is set
309
+ if @api_client.config.client_side_validation && object_type.nil?
310
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.get_page"
311
+ end
312
+ # verify the required parameter 'object_id' is set
313
+ if @api_client.config.client_side_validation && object_id.nil?
314
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling BasicApi.get_page"
315
+ end
316
+ # verify the required parameter 'to_object_type' is set
317
+ if @api_client.config.client_side_validation && to_object_type.nil?
318
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BasicApi.get_page"
319
+ end
320
+ # resource path
321
+ local_var_path = '/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
322
+
323
+ # query parameters
324
+ query_params = opts[:query_params] || {}
325
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
326
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
327
+
328
+ # header parameters
329
+ header_params = opts[:header_params] || {}
330
+ # HTTP header 'Accept' (if needed)
331
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
332
+
333
+ # form parameters
334
+ form_params = opts[:form_params] || {}
335
+
336
+ # http body (model)
337
+ post_body = opts[:debug_body]
338
+
339
+ # return_type
340
+ return_type = opts[:debug_return_type] || 'CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'
341
+
342
+ # auth_names
343
+ auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
344
+
345
+ new_options = opts.merge(
346
+ :operation => :"BasicApi.get_page",
347
+ :header_params => header_params,
348
+ :query_params => query_params,
349
+ :form_params => form_params,
350
+ :body => post_body,
351
+ :auth_names => auth_names,
352
+ :return_type => return_type
353
+ )
354
+
355
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug "API called: BasicApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
358
+ end
359
+ return data, status_code, headers
360
+ end
361
+ end
362
+ end
363
+ end
364
+ end
365
+ end