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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -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/version.rb +1 -1
  169. data/spec/discovery/crm/associations/client_spec.rb +1 -0
  170. data/spec/discovery/crm/associations/schema/types_api_spec.rb +7 -0
  171. data/spec/discovery/crm/associations/v4/basic_api_spec.rb +10 -0
  172. data/spec/discovery/crm/associations/v4/client_spec.rb +7 -0
  173. data/spec/discovery/crm/associations/v4/{definitions_api_spec.rb → schema/definitions_api_spec.rb} +3 -3
  174. data/spec/discovery/crm/objects/client_spec.rb +1 -0
  175. data/spec/discovery/crm/objects/communications/basic_api_spec.rb +10 -0
  176. data/spec/discovery/crm/objects/communications/batch_api_spec.rb +10 -0
  177. data/spec/discovery/crm/objects/communications/public_object_api_spec.rb +7 -0
  178. data/spec/discovery/crm/objects/communications/search_api_spec.rb +7 -0
  179. metadata +145 -10
  180. data/lib/hubspot/codegen/crm/associations/api/types_api.rb +0 -95
  181. data/lib/hubspot/codegen/crm/associations/v4/api/definitions_api.rb +0 -332
  182. data/lib/hubspot/discovery/crm/associations/api/types_api.rb +0 -13
  183. data/spec/discovery/crm/associations/types_api_spec.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c704c669acaebf044517de23f66af799efeb23849c0841e9e9012a6861d94ff
4
- data.tar.gz: 8e2353c95414bcbe30f5a967140d7d95338cba1912904e6cdbde2cb2fe5c4991
3
+ metadata.gz: bf03f85e815cda2314c5d9433d05baf61dc9cff1578027fbf719df17346b2a22
4
+ data.tar.gz: b10c430908fde3591fbe586ec97a1078ea4d5dfc6b5c151c02468d5650a76b61
5
5
  SHA512:
6
- metadata.gz: d50f6394df9380813c6b99e12f7d71a94344bf93aa6cef9deb39ec1aa38da9285f282690d1c0b874ed597be5e8c81331b4631f7727e1059edddc65841ee9ace0
7
- data.tar.gz: 3e8e97a0d8f83a0296b444bd7c2a84a3e22cbd433541e94decbd173c6d66b87e27a26c919b6947943fc3c4561447b66e58d8688b83d5793c52741bf4214a72d2
6
+ metadata.gz: ba61d9af22ac49d15c2ca40bf8545bd036441eba289b13faa18d657717ae40bc5d2c830a220ac44fd625a31020bc7844d2bfd5a6ce84c6dd5ba8a7d02f239ac7
7
+ data.tar.gz: 24b656e117c4d7515ef257ba111634ecff1267831934361bf59046090bfd3aabf20929b966dc041c3a548ede2aabce7770a31841c16988c297d54ffd032de766
data/CHANGELOG.md CHANGED
@@ -5,9 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased](https://github.com/HubSpot/hubspot-api-ruby/compare/v17.0.0-beta.2...HEAD)
8
+ ## [Unreleased](https://github.com/HubSpot/hubspot-api-ruby/compare/v17.0.0-beta.3...HEAD)
9
9
 
10
10
 
11
+ ## [17.0.0-beta.3] - 2023-05-12
12
+
13
+ ## Added
14
+
15
+ - `crm.associations.v4.basic_api` Api.
16
+ - `crm.objects.communications` Api client
17
+
18
+ ### Updated
19
+
20
+ - `crm.associations.types_api` => `crm.associations.schema.types_api`.
21
+ - `crm.associations.v4.definitions_api` => `crm.associations.v4.schema.definitions_api`.
22
+
11
23
  ## [17.0.0-beta.2] - 2023-04-28
12
24
  ### Updated
13
25
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hubspot-api-client (17.0.0-beta.2)
4
+ hubspot-api-client (17.0.0-beta.3)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.4.0)
7
7
 
@@ -0,0 +1,97 @@
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 'cgi'
14
+
15
+ module Hubspot
16
+ module Crm
17
+ module Associations
18
+ module Schema
19
+ class TypesApi
20
+ attr_accessor :api_client
21
+
22
+ def initialize(api_client = ApiClient.default)
23
+ @api_client = api_client
24
+ end
25
+ # List association types
26
+ # List all the valid association types available between two object types
27
+ # @param from_object_type [String]
28
+ # @param to_object_type [String]
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [CollectionResponsePublicAssociationDefinitionNoPaging]
31
+ def get_all(from_object_type, to_object_type, opts = {})
32
+ data, _status_code, _headers = get_all_with_http_info(from_object_type, to_object_type, opts)
33
+ data
34
+ end
35
+
36
+ # List association types
37
+ # List all the valid association types available between two object types
38
+ # @param from_object_type [String]
39
+ # @param to_object_type [String]
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [Array<(CollectionResponsePublicAssociationDefinitionNoPaging, Integer, Hash)>] CollectionResponsePublicAssociationDefinitionNoPaging data, response status code and response headers
42
+ def get_all_with_http_info(from_object_type, to_object_type, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug 'Calling API: TypesApi.get_all ...'
45
+ end
46
+ # verify the required parameter 'from_object_type' is set
47
+ if @api_client.config.client_side_validation && from_object_type.nil?
48
+ fail ArgumentError, "Missing the required parameter 'from_object_type' when calling TypesApi.get_all"
49
+ end
50
+ # verify the required parameter 'to_object_type' is set
51
+ if @api_client.config.client_side_validation && to_object_type.nil?
52
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling TypesApi.get_all"
53
+ end
54
+ # resource path
55
+ local_var_path = '/crm/v3/associations/{fromObjectType}/{toObjectType}/types'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
56
+
57
+ # query parameters
58
+ query_params = opts[:query_params] || {}
59
+
60
+ # header parameters
61
+ header_params = opts[:header_params] || {}
62
+ # HTTP header 'Accept' (if needed)
63
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:debug_body]
70
+
71
+ # return_type
72
+ return_type = opts[:debug_return_type] || 'CollectionResponsePublicAssociationDefinitionNoPaging'
73
+
74
+ # auth_names
75
+ auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
76
+
77
+ new_options = opts.merge(
78
+ :operation => :"TypesApi.get_all",
79
+ :header_params => header_params,
80
+ :query_params => query_params,
81
+ :form_params => form_params,
82
+ :body => post_body,
83
+ :auth_names => auth_names,
84
+ :return_type => return_type
85
+ )
86
+
87
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: TypesApi#get_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ return data, status_code, headers
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,412 @@
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 'json'
15
+ require 'logger'
16
+ require 'tempfile'
17
+ require 'time'
18
+ require 'typhoeus'
19
+
20
+ module Hubspot
21
+ module Crm
22
+ module Associations
23
+ module Schema
24
+ class ApiClient
25
+ # The Configuration object holding settings to be used in the API client.
26
+ attr_accessor :config
27
+
28
+ # Defines the headers to be used in HTTP requests of all API calls by default.
29
+ #
30
+ # @return [Hash]
31
+ attr_accessor :default_headers
32
+
33
+ # Initializes the ApiClient
34
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
35
+ def initialize(config = Configuration.default)
36
+ @config = config
37
+ @user_agent = "hubspot-api-client-ruby; #{VERSION}"
38
+ @default_headers = {
39
+ 'Content-Type' => 'application/json',
40
+ 'User-Agent' => @user_agent
41
+ }
42
+ end
43
+
44
+ def self.default
45
+ @@default ||= ApiClient.new
46
+ end
47
+
48
+ # Call an API with given options.
49
+ #
50
+ # @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
51
+ # the data deserialized from response body (could be nil), response status code and response headers.
52
+ def call_api(http_method, path, opts = {})
53
+ request = build_request(http_method, path, opts)
54
+ response = request.run
55
+
56
+ if @config.debugging
57
+ @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
58
+ end
59
+
60
+ if !response.success? && config.error_handler.any?
61
+ config.error_handler.each do |statuses, opts|
62
+ statuses = statuses.is_a?(Integer) ? [statuses] : statuses
63
+
64
+ retries = opts[:max_retries] || 5
65
+ while retries > 0 && statuses.include?(response.code)
66
+ sleep opts[:seconds_delay] if opts[:seconds_delay]
67
+ response = request.run
68
+ opts[:retry_block].call if opts[:retry_block]
69
+ retries -= 1
70
+ end
71
+ end
72
+ end
73
+
74
+ unless response.success?
75
+ if response.timed_out?
76
+ fail ApiError.new('Connection timed out')
77
+ elsif response.code == 0
78
+ # Errors from libcurl will be made visible here
79
+ fail ApiError.new(:code => 0,
80
+ :message => response.return_message)
81
+ else
82
+ fail ApiError.new(:code => response.code,
83
+ :response_headers => response.headers,
84
+ :response_body => response.body),
85
+ response.status_message
86
+ end
87
+ end
88
+
89
+ if opts[:return_type]
90
+ data = deserialize(response, opts[:return_type])
91
+ else
92
+ data = nil
93
+ end
94
+ return data, response.code, response.headers
95
+ end
96
+
97
+ # Builds the HTTP request
98
+ #
99
+ # @param [String] http_method HTTP method/verb (e.g. POST)
100
+ # @param [String] path URL path (e.g. /account/new)
101
+ # @option opts [Hash] :header_params Header parameters
102
+ # @option opts [Hash] :query_params Query parameters
103
+ # @option opts [Hash] :form_params Query parameters
104
+ # @option opts [Object] :body HTTP body (JSON/XML)
105
+ # @return [Typhoeus::Request] A Typhoeus Request
106
+ def build_request(http_method, path, opts = {})
107
+ url = build_request_url(path, opts)
108
+ http_method = http_method.to_sym.downcase
109
+
110
+ header_params = @default_headers.merge(opts[:header_params] || {})
111
+ query_params = opts[:query_params] || {}
112
+ form_params = opts[:form_params] || {}
113
+ follow_location = opts[:follow_location] || true
114
+
115
+ update_params_for_auth! header_params, query_params, opts[:auth_names]
116
+
117
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
118
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
119
+
120
+ req_opts = {
121
+ :method => http_method,
122
+ :headers => header_params,
123
+ :params => query_params,
124
+ :params_encoding => @config.params_encoding,
125
+ :timeout => @config.timeout,
126
+ :ssl_verifypeer => @config.verify_ssl,
127
+ :ssl_verifyhost => _verify_ssl_host,
128
+ :sslcert => @config.cert_file,
129
+ :sslkey => @config.key_file,
130
+ :verbose => @config.debugging,
131
+ :followlocation => follow_location
132
+ }
133
+
134
+ # set custom cert, if provided
135
+ req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
136
+
137
+ if [:post, :patch, :put, :delete].include?(http_method)
138
+ req_body = build_request_body(header_params, form_params, opts[:body])
139
+ req_opts.update :body => req_body
140
+ if @config.debugging
141
+ @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n"
142
+ end
143
+ end
144
+
145
+ request = Typhoeus::Request.new(url, req_opts)
146
+ download_file(request) if opts[:return_type] == 'File'
147
+ request
148
+ end
149
+
150
+ # Builds the HTTP request body
151
+ #
152
+ # @param [Hash] header_params Header parameters
153
+ # @param [Hash] form_params Query parameters
154
+ # @param [Object] body HTTP body (JSON/XML)
155
+ # @return [String] HTTP body data in the form of string
156
+ def build_request_body(header_params, form_params, body)
157
+ # http form
158
+ if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
159
+ header_params['Content-Type'] == 'multipart/form-data'
160
+ data = {}
161
+ form_params.each do |key, value|
162
+ case value
163
+ when ::File, ::Array, nil
164
+ # let typhoeus handle File, Array and nil parameters
165
+ data[key] = value
166
+ else
167
+ data[key] = value.to_s
168
+ end
169
+ end
170
+ elsif body
171
+ data = body.is_a?(String) ? body : body.to_json
172
+ else
173
+ data = nil
174
+ end
175
+ data
176
+ end
177
+
178
+ # Save response body into a file in (the defined) temporary folder, using the filename
179
+ # from the "Content-Disposition" header if provided, otherwise a random filename.
180
+ # The response body is written to the file in chunks in order to handle files which
181
+ # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby
182
+ # process can use.
183
+ #
184
+ # @see Configuration#temp_folder_path
185
+ def download_file(request)
186
+ tempfile = nil
187
+ encoding = nil
188
+ request.on_headers do |response|
189
+ content_disposition = response.headers['Content-Disposition']
190
+ if content_disposition && content_disposition =~ /filename=/i
191
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
192
+ prefix = sanitize_filename(filename)
193
+ else
194
+ prefix = 'download-'
195
+ end
196
+ prefix = prefix + '-' unless prefix.end_with?('-')
197
+ encoding = response.body.encoding
198
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
199
+ @tempfile = tempfile
200
+ end
201
+ request.on_body do |chunk|
202
+ chunk.force_encoding(encoding)
203
+ tempfile.write(chunk)
204
+ end
205
+ request.on_complete do |response|
206
+ if tempfile
207
+ tempfile.close
208
+ @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
209
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
210
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
211
+ "explicitly with `tempfile.delete`"
212
+ end
213
+ end
214
+ end
215
+
216
+ # Check if the given MIME is a JSON MIME.
217
+ # JSON MIME examples:
218
+ # application/json
219
+ # application/json; charset=UTF8
220
+ # APPLICATION/JSON
221
+ # */*
222
+ # @param [String] mime MIME
223
+ # @return [Boolean] True if the MIME is application/json
224
+ def json_mime?(mime)
225
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
226
+ end
227
+
228
+ # Deserialize the response to the given return type.
229
+ #
230
+ # @param [Response] response HTTP response
231
+ # @param [String] return_type some examples: "User", "Array<User>", "Hash<String, Integer>"
232
+ def deserialize(response, return_type)
233
+ body = response.body
234
+
235
+ # handle file downloading - return the File instance processed in request callbacks
236
+ # note that response body is empty when the file is written in chunks in request on_body callback
237
+ return @tempfile if return_type == 'File'
238
+
239
+ return nil if body.nil? || body.empty?
240
+
241
+ # return response body directly for String return type
242
+ return body if return_type == 'String'
243
+
244
+ # ensuring a default content type
245
+ content_type = response.headers['Content-Type'] || 'application/json'
246
+
247
+ fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type)
248
+
249
+ begin
250
+ data = JSON.parse("[#{body}]", :symbolize_names => true)[0]
251
+ rescue JSON::ParserError => e
252
+ if %w(String Date Time).include?(return_type)
253
+ data = body
254
+ else
255
+ raise e
256
+ end
257
+ end
258
+
259
+ convert_to_type data, return_type
260
+ end
261
+
262
+ # Convert data to the given return type.
263
+ # @param [Object] data Data to be converted
264
+ # @param [String] return_type Return type
265
+ # @return [Mixed] Data in a particular type
266
+ def convert_to_type(data, return_type)
267
+ return nil if data.nil?
268
+ case return_type
269
+ when 'String'
270
+ data.to_s
271
+ when 'Integer'
272
+ data.to_i
273
+ when 'Float'
274
+ data.to_f
275
+ when 'Boolean'
276
+ data == true
277
+ when 'Time'
278
+ # parse date time (expecting ISO 8601 format)
279
+ Time.parse data
280
+ when 'Date'
281
+ # parse date time (expecting ISO 8601 format)
282
+ Date.parse data
283
+ when 'Object'
284
+ # generic object (usually a Hash), return directly
285
+ data
286
+ when /\AArray<(.+)>\z/
287
+ # e.g. Array<Pet>
288
+ sub_type = $1
289
+ data.map { |item| convert_to_type(item, sub_type) }
290
+ when /\AHash\<String, (.+)\>\z/
291
+ # e.g. Hash<String, Integer>
292
+ sub_type = $1
293
+ {}.tap do |hash|
294
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
295
+ end
296
+ else
297
+ # models (e.g. Pet) or oneOf
298
+ klass = Hubspot::Crm::Associations::Schema.const_get(return_type)
299
+ klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
300
+ end
301
+ end
302
+
303
+ # Sanitize filename by removing path.
304
+ # e.g. ../../sun.gif becomes sun.gif
305
+ #
306
+ # @param [String] filename the filename to be sanitized
307
+ # @return [String] the sanitized filename
308
+ def sanitize_filename(filename)
309
+ filename.gsub(/.*[\/\\]/, '')
310
+ end
311
+
312
+ def build_request_url(path, opts = {})
313
+ # Add leading and trailing slashes to path
314
+ path = "/#{path}".gsub(/\/+/, '/')
315
+ @config.base_url(opts[:operation]) + path
316
+ end
317
+
318
+ # Update header and query params based on authentication settings.
319
+ #
320
+ # @param [Hash] header_params Header parameters
321
+ # @param [Hash] query_params Query parameters
322
+ # @param [String] auth_names Authentication scheme name
323
+ def update_params_for_auth!(header_params, query_params, auth_names)
324
+ Array(auth_names).each do |auth_name|
325
+ auth_setting = @config.auth_settings[auth_name]
326
+ next unless auth_setting
327
+ case auth_setting[:in]
328
+ when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
329
+ when 'query' then query_params[auth_setting[:key]] = auth_setting[:value]
330
+ else fail ArgumentError, 'Authentication token must be in `query` or `header`'
331
+ end
332
+ end
333
+ end
334
+
335
+ # Sets user agent in HTTP header
336
+ #
337
+ # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0)
338
+ def user_agent=(user_agent)
339
+ @user_agent = user_agent
340
+ @default_headers['User-Agent'] = @user_agent
341
+ end
342
+
343
+ # Return Accept header based on an array of accepts provided.
344
+ # @param [Array] accepts array for Accept
345
+ # @return [String] the Accept header (e.g. application/json)
346
+ def select_header_accept(accepts)
347
+ return nil if accepts.nil? || accepts.empty?
348
+ # use JSON when present, otherwise use all of the provided
349
+ json_accept = accepts.find { |s| json_mime?(s) }
350
+ json_accept || accepts.join(',')
351
+ end
352
+
353
+ # Return Content-Type header based on an array of content types provided.
354
+ # @param [Array] content_types array for Content-Type
355
+ # @return [String] the Content-Type header (e.g. application/json)
356
+ def select_header_content_type(content_types)
357
+ # return nil by default
358
+ return if content_types.nil? || content_types.empty?
359
+ # use JSON when present, otherwise use the first one
360
+ json_content_type = content_types.find { |s| json_mime?(s) }
361
+ json_content_type || content_types.first
362
+ end
363
+
364
+ # Convert object (array, hash, object, etc) to JSON string.
365
+ # @param [Object] model object to be converted into JSON string
366
+ # @return [String] JSON string representation of the object
367
+ def object_to_http_body(model)
368
+ return model if model.nil? || model.is_a?(String)
369
+ local_body = nil
370
+ if model.is_a?(Array)
371
+ local_body = model.map { |m| object_to_hash(m) }
372
+ else
373
+ local_body = object_to_hash(model)
374
+ end
375
+ local_body.to_json
376
+ end
377
+
378
+ # Convert object(non-array) to hash.
379
+ # @param [Object] obj object to be converted into JSON string
380
+ # @return [String] JSON string representation of the object
381
+ def object_to_hash(obj)
382
+ if obj.respond_to?(:to_hash)
383
+ obj.to_hash
384
+ else
385
+ obj
386
+ end
387
+ end
388
+
389
+ # Build parameter value according to the given collection format.
390
+ # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
391
+ def build_collection_param(param, collection_format)
392
+ case collection_format
393
+ when :csv
394
+ param.join(',')
395
+ when :ssv
396
+ param.join(' ')
397
+ when :tsv
398
+ param.join("\t")
399
+ when :pipes
400
+ param.join('|')
401
+ when :multi
402
+ # return the array directly as typhoeus will handle it as expected
403
+ param
404
+ else
405
+ fail "unknown collection format: #{collection_format.inspect}"
406
+ end
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
@@ -0,0 +1,63 @@
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
+ module Hubspot
14
+ module Crm
15
+ module Associations
16
+ module Schema
17
+ class ApiError < ::StandardError
18
+ attr_reader :code, :response_headers, :response_body
19
+
20
+ # Usage examples:
21
+ # ApiError.new
22
+ # ApiError.new("message")
23
+ # ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
24
+ # ApiError.new(:code => 404, :message => "Not Found")
25
+ def initialize(arg = nil)
26
+ if arg.is_a? Hash
27
+ if arg.key?(:message) || arg.key?('message')
28
+ super(arg[:message] || arg['message'])
29
+ else
30
+ super arg
31
+ end
32
+
33
+ arg.each do |k, v|
34
+ instance_variable_set "@#{k}", v
35
+ end
36
+ else
37
+ super arg
38
+ end
39
+ end
40
+
41
+ # Override to_s to display a friendly error message
42
+ def to_s
43
+ message
44
+ end
45
+
46
+ def message
47
+ if @message.nil?
48
+ msg = "Error message: the server returns an error"
49
+ else
50
+ msg = @message
51
+ end
52
+
53
+ msg += "\nHTTP status code: #{code}" if code
54
+ msg += "\nResponse headers: #{response_headers}" if response_headers
55
+ msg += "\nResponse body: #{response_body}" if response_body
56
+
57
+ msg
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end