hubspot-api-client 7.1.1 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +41 -0
  4. data/lib/hubspot-api-client.rb +55 -0
  5. data/lib/hubspot/codegen/crm/objects/api/associations_api.rb +278 -0
  6. data/lib/hubspot/codegen/crm/objects/api/basic_api.rb +405 -0
  7. data/lib/hubspot/codegen/crm/objects/api/batch_api.rb +309 -0
  8. data/lib/hubspot/codegen/crm/objects/api/search_api.rb +96 -0
  9. data/lib/hubspot/codegen/crm/objects/api_client.rb +424 -0
  10. data/lib/hubspot/codegen/crm/objects/api_error.rb +61 -0
  11. data/lib/hubspot/codegen/crm/objects/configuration.rb +258 -0
  12. data/lib/hubspot/codegen/crm/objects/models/associated_id.rb +229 -0
  13. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_batch_input.rb +217 -0
  14. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_id.rb +217 -0
  15. data/lib/hubspot/codegen/crm/objects/models/batch_input_simple_public_object_input.rb +217 -0
  16. data/lib/hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id.rb +242 -0
  17. data/lib/hubspot/codegen/crm/objects/models/batch_response_simple_public_object.rb +313 -0
  18. data/lib/hubspot/codegen/crm/objects/models/batch_response_simple_public_object_with_errors.rb +333 -0
  19. data/lib/hubspot/codegen/crm/objects/models/collection_response_associated_id.rb +226 -0
  20. data/lib/hubspot/codegen/crm/objects/models/collection_response_simple_public_object.rb +226 -0
  21. data/lib/hubspot/codegen/crm/objects/models/collection_response_with_total_simple_public_object.rb +241 -0
  22. data/lib/hubspot/codegen/crm/objects/models/error.rb +292 -0
  23. data/lib/hubspot/codegen/crm/objects/models/error_detail.rb +258 -0
  24. data/lib/hubspot/codegen/crm/objects/models/filter.rb +272 -0
  25. data/lib/hubspot/codegen/crm/objects/models/filter_group.rb +217 -0
  26. data/lib/hubspot/codegen/crm/objects/models/next_page.rb +224 -0
  27. data/lib/hubspot/codegen/crm/objects/models/paging.rb +219 -0
  28. data/lib/hubspot/codegen/crm/objects/models/previous_page.rb +224 -0
  29. data/lib/hubspot/codegen/crm/objects/models/public_object_search_request.rb +286 -0
  30. data/lib/hubspot/codegen/crm/objects/models/simple_public_object.rb +288 -0
  31. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_batch_input.rb +231 -0
  32. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_id.rb +215 -0
  33. data/lib/hubspot/codegen/crm/objects/models/simple_public_object_input.rb +217 -0
  34. data/lib/hubspot/codegen/crm/schemas/api/core_api.rb +478 -0
  35. data/lib/hubspot/codegen/crm/schemas/api/default_api.rb +84 -0
  36. data/lib/hubspot/codegen/crm/schemas/api_client.rb +424 -0
  37. data/lib/hubspot/codegen/crm/schemas/api_error.rb +61 -0
  38. data/lib/hubspot/codegen/crm/schemas/configuration.rb +258 -0
  39. data/lib/hubspot/codegen/crm/schemas/models/association_definition.rb +350 -0
  40. data/lib/hubspot/codegen/crm/schemas/models/association_definition_egg.rb +315 -0
  41. data/lib/hubspot/codegen/crm/schemas/models/collection_response_object_schema.rb +226 -0
  42. data/lib/hubspot/codegen/crm/schemas/models/error.rb +292 -0
  43. data/lib/hubspot/codegen/crm/schemas/models/error_detail.rb +258 -0
  44. data/lib/hubspot/codegen/crm/schemas/models/next_page.rb +224 -0
  45. data/lib/hubspot/codegen/crm/schemas/models/object_schema.rb +389 -0
  46. data/lib/hubspot/codegen/crm/schemas/models/object_schema_egg.rb +325 -0
  47. data/lib/hubspot/codegen/crm/schemas/models/object_type_definition.rb +364 -0
  48. data/lib/hubspot/codegen/crm/schemas/models/object_type_definition_labels.rb +221 -0
  49. data/lib/hubspot/codegen/crm/schemas/models/object_type_definition_patch.rb +265 -0
  50. data/lib/hubspot/codegen/crm/schemas/models/object_type_property_create.rb +356 -0
  51. data/lib/hubspot/codegen/crm/schemas/models/option.rb +266 -0
  52. data/lib/hubspot/codegen/crm/schemas/models/option_input.rb +271 -0
  53. data/lib/hubspot/codegen/crm/schemas/models/paging.rb +219 -0
  54. data/lib/hubspot/codegen/crm/schemas/models/previous_page.rb +224 -0
  55. data/lib/hubspot/codegen/crm/schemas/models/property.rb +465 -0
  56. data/lib/hubspot/codegen/crm/schemas/models/property_modification_metadata.rb +252 -0
  57. data/lib/hubspot/version.rb +1 -1
  58. metadata +54 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d63f5fb2684a5ea317ba3b2f31f7c1abf833c7ca4da78f9f3387f3cea0b84c3
4
- data.tar.gz: '091a9778a7de884ee9386f58591d4e320508c52de554c997e54f473e3f668844'
3
+ metadata.gz: d6d857315ad1b39c4372fe92d5fb0c88dee2c7d8a13735c073e811800a2f86b9
4
+ data.tar.gz: e4c48d566f2b980d6deddb7d675f4a570586844767feafcc34863324adf03eef
5
5
  SHA512:
6
- metadata.gz: 8834271f5d7e99b4f65eaa04b6c697fa0b28c21e43a6de91eb59e8d3f9eae0fd65f0cdd32a8f70d43a6c21e22f55b261bcfd5d0c2a0b23d335ba47e873e7ca5a
7
- data.tar.gz: a5acf12bdf52e9e11064836f339fc9bffe68af8141dba8c99805c24a2df4f2614f8f9c9868629efbd6a9f2392c94eef6d1f4fed873bc5315a9ef1a23c76a7226
6
+ metadata.gz: 154737d6244f373d18659e54c73d090eeb1f73583a46f648758c702fadcd73252a4fe2afa5be12f4f3b5eb1b7e9e8edd0c8e035d24462a1dda5bd674d558d573
7
+ data.tar.gz: 8e231c37575ea84e5e7d712fea575758f5f6b01226bb45a2d598b8f2c57a0e890719bb063fe72bcbca8f1ce556298bce6a711137c1d057956968b59def16caa1
@@ -5,6 +5,11 @@ 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
+ ## [7.2.0] - 2020-10-05
9
+
10
+ - Add Objects client
11
+ - Add Schemas client
12
+
8
13
  ## [7.1.1] - 2020-08-17
9
14
 
10
15
  - Fix sample apps API call bugs
data/README.md CHANGED
@@ -44,6 +44,47 @@ all_contacts = basic_api.get_all(auth_names: 'oauth2')
44
44
  Please note that pagination is used under the hood to get all results.
45
45
 
46
46
 
47
+ ### Crm Object Schemas client usage:
48
+
49
+ #### Creation
50
+
51
+ ```ruby
52
+ config = ::Hubspot::Crm::Schemas::Configuration.new do |config|
53
+ config.api_key = { 'hapikey' => 'your_hapikey' }
54
+ end
55
+ api_client = ::Hubspot::Crm::Schemas::ApiClient.new(config)
56
+ api = ::Hubspot::Crm::Schemas::CoreApi.new(api_client)
57
+ labels = ::Hubspot::Crm::Schemas::ObjectTypeDefinitionLabels.new(singular: 'My object', plural: 'My objects')
58
+ option = ::Hubspot::Crm::Schemas::OptionInput.new(
59
+ label: 'Option A',
60
+ value: 'A',
61
+ description: 'Choice number one',
62
+ display_order: 1,
63
+ hidden: false
64
+ )
65
+ property = ::Hubspot::Crm::Schemas::ObjectTypePropertyCreate.new(
66
+ name: 'property001',
67
+ label: 'My object property',
68
+ group_name: 'my_object_information',
69
+ options: [option],
70
+ display_order: 2,
71
+ type: 'enumeration',
72
+ field_type: 'select'
73
+ )
74
+ object_schema_egg = ::Hubspot::Crm::Schemas::ObjectSchemaEgg.new(
75
+ labels: labels,
76
+ required_properties: ['property001'],
77
+ searchable_properties: [],
78
+ primary_display_property: 'property001',
79
+ secondary_display_properties: [],
80
+ properties: [property],
81
+ associated_objects: ['CONTACT'],
82
+ name: 'my_object'
83
+ )
84
+ api_response = api.create(object_schema_egg)
85
+ ```
86
+
87
+
47
88
  ### Error handling
48
89
 
49
90
  #### You can set number of retry attempts and delay in seconds before retry on specific status code of response.
@@ -155,6 +155,30 @@ require 'hubspot/codegen/crm/contacts/models/simple_public_object_batch_input'
155
155
  require 'hubspot/codegen/crm/contacts/models/simple_public_object_id'
156
156
  require 'hubspot/codegen/crm/contacts/models/simple_public_object_input'
157
157
 
158
+ require 'hubspot/codegen/crm/schemas/api_client'
159
+ require 'hubspot/codegen/crm/schemas/api_error'
160
+ require 'hubspot/codegen/crm/schemas/configuration'
161
+ require 'hubspot/codegen/crm/schemas/api/core_api'
162
+ require 'hubspot/codegen/crm/schemas/api/default_api'
163
+ require 'hubspot/codegen/crm/schemas/models/association_definition'
164
+ require 'hubspot/codegen/crm/schemas/models/association_definition_egg'
165
+ require 'hubspot/codegen/crm/schemas/models/collection_response_object_schema'
166
+ require 'hubspot/codegen/crm/schemas/models/error'
167
+ require 'hubspot/codegen/crm/schemas/models/error_detail'
168
+ require 'hubspot/codegen/crm/schemas/models/next_page'
169
+ require 'hubspot/codegen/crm/schemas/models/object_schema'
170
+ require 'hubspot/codegen/crm/schemas/models/object_schema_egg'
171
+ require 'hubspot/codegen/crm/schemas/models/object_type_definition'
172
+ require 'hubspot/codegen/crm/schemas/models/object_type_definition_labels'
173
+ require 'hubspot/codegen/crm/schemas/models/object_type_definition_patch'
174
+ require 'hubspot/codegen/crm/schemas/models/object_type_property_create'
175
+ require 'hubspot/codegen/crm/schemas/models/option'
176
+ require 'hubspot/codegen/crm/schemas/models/option_input'
177
+ require 'hubspot/codegen/crm/schemas/models/paging'
178
+ require 'hubspot/codegen/crm/schemas/models/previous_page'
179
+ require 'hubspot/codegen/crm/schemas/models/property'
180
+ require 'hubspot/codegen/crm/schemas/models/property_modification_metadata'
181
+
158
182
  require 'hubspot/codegen/crm/deals/api_client'
159
183
  require 'hubspot/codegen/crm/deals/api_error'
160
184
  require 'hubspot/codegen/crm/deals/configuration'
@@ -253,6 +277,36 @@ require 'hubspot/codegen/crm/line_items/models/simple_public_object_batch_input'
253
277
  require 'hubspot/codegen/crm/line_items/models/simple_public_object_id'
254
278
  require 'hubspot/codegen/crm/line_items/models/simple_public_object_input'
255
279
 
280
+ require 'hubspot/codegen/crm/objects/api_client'
281
+ require 'hubspot/codegen/crm/objects/api_error'
282
+ require 'hubspot/codegen/crm/objects/configuration'
283
+ require 'hubspot/codegen/crm/objects/api/associations_api'
284
+ require 'hubspot/codegen/crm/objects/api/basic_api'
285
+ require 'hubspot/codegen/crm/objects/api/batch_api'
286
+ require 'hubspot/codegen/crm/objects/api/search_api'
287
+ require 'hubspot/codegen/crm/objects/models/associated_id'
288
+ require 'hubspot/codegen/crm/objects/models/batch_input_simple_public_object_batch_input'
289
+ require 'hubspot/codegen/crm/objects/models/batch_input_simple_public_object_id'
290
+ require 'hubspot/codegen/crm/objects/models/batch_input_simple_public_object_input'
291
+ require 'hubspot/codegen/crm/objects/models/batch_read_input_simple_public_object_id'
292
+ require 'hubspot/codegen/crm/objects/models/batch_response_simple_public_object'
293
+ require 'hubspot/codegen/crm/objects/models/batch_response_simple_public_object_with_errors'
294
+ require 'hubspot/codegen/crm/objects/models/collection_response_associated_id'
295
+ require 'hubspot/codegen/crm/objects/models/collection_response_simple_public_object'
296
+ require 'hubspot/codegen/crm/objects/models/collection_response_with_total_simple_public_object'
297
+ require 'hubspot/codegen/crm/objects/models/error'
298
+ require 'hubspot/codegen/crm/objects/models/error_detail'
299
+ require 'hubspot/codegen/crm/objects/models/filter'
300
+ require 'hubspot/codegen/crm/objects/models/filter_group'
301
+ require 'hubspot/codegen/crm/objects/models/next_page'
302
+ require 'hubspot/codegen/crm/objects/models/paging'
303
+ require 'hubspot/codegen/crm/objects/models/previous_page'
304
+ require 'hubspot/codegen/crm/objects/models/public_object_search_request'
305
+ require 'hubspot/codegen/crm/objects/models/simple_public_object'
306
+ require 'hubspot/codegen/crm/objects/models/simple_public_object_batch_input'
307
+ require 'hubspot/codegen/crm/objects/models/simple_public_object_id'
308
+ require 'hubspot/codegen/crm/objects/models/simple_public_object_input'
309
+
256
310
  require 'hubspot/codegen/crm/owners/api_client'
257
311
  require 'hubspot/codegen/crm/owners/api_error'
258
312
  require 'hubspot/codegen/crm/owners/configuration'
@@ -439,6 +493,7 @@ require 'hubspot/codegen/webhooks/api/settings_api'
439
493
  require 'hubspot/codegen/webhooks/api/subscriptions_api'
440
494
  require 'hubspot/codegen/webhooks/models/batch_input_subscription_batch_update_request'
441
495
  require 'hubspot/codegen/webhooks/models/batch_response_subscription_response'
496
+ require 'hubspot/codegen/webhooks/models/batch_response_subscription_response_with_errors'
442
497
  require 'hubspot/codegen/webhooks/models/error'
443
498
  require 'hubspot/codegen/webhooks/models/error_detail'
444
499
  require 'hubspot/codegen/webhooks/models/settings_change_request'
@@ -0,0 +1,278 @@
1
+ =begin
2
+ #CRM Objects
3
+
4
+ #CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
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 'cgi'
14
+
15
+ module Hubspot
16
+ module Crm
17
+ module Objects
18
+ class AssociationsApi
19
+ attr_accessor :api_client
20
+
21
+ def initialize(api_client = ApiClient.default)
22
+ @api_client = api_client
23
+ end
24
+ # Remove an association between two objects
25
+ # @param object_type [String]
26
+ # @param object_id [String]
27
+ # @param to_object_type [String]
28
+ # @param to_object_id [String]
29
+ # @param association_type [String]
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [nil]
32
+ def archive(object_type, object_id, to_object_type, to_object_id, association_type, opts = {})
33
+ archive_with_http_info(object_type, object_id, to_object_type, to_object_id, association_type, opts)
34
+ nil
35
+ end
36
+
37
+ # Remove an association between two objects
38
+ # @param object_type [String]
39
+ # @param object_id [String]
40
+ # @param to_object_type [String]
41
+ # @param to_object_id [String]
42
+ # @param association_type [String]
43
+ # @param [Hash] opts the optional parameters
44
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
45
+ def archive_with_http_info(object_type, object_id, to_object_type, to_object_id, association_type, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: AssociationsApi.archive ...'
48
+ end
49
+ # verify the required parameter 'object_type' is set
50
+ if @api_client.config.client_side_validation && object_type.nil?
51
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling AssociationsApi.archive"
52
+ end
53
+ # verify the required parameter 'object_id' is set
54
+ if @api_client.config.client_side_validation && object_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling AssociationsApi.archive"
56
+ end
57
+ # verify the required parameter 'to_object_type' is set
58
+ if @api_client.config.client_side_validation && to_object_type.nil?
59
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling AssociationsApi.archive"
60
+ end
61
+ # verify the required parameter 'to_object_id' is set
62
+ if @api_client.config.client_side_validation && to_object_id.nil?
63
+ fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.archive"
64
+ end
65
+ # verify the required parameter 'association_type' is set
66
+ if @api_client.config.client_side_validation && association_type.nil?
67
+ fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.archive"
68
+ end
69
+ # resource path
70
+ local_var_path = '/crm/v3/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}/{associationType}'.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)).sub('{' + 'associationType' + '}', CGI.escape(association_type.to_s))
71
+
72
+ # query parameters
73
+ query_params = opts[:query_params] || {}
74
+
75
+ # header parameters
76
+ header_params = opts[:header_params] || {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
79
+
80
+ # form parameters
81
+ form_params = opts[:form_params] || {}
82
+
83
+ # http body (model)
84
+ post_body = opts[:body]
85
+
86
+ # return_type
87
+ return_type = opts[:return_type]
88
+
89
+ # auth_names
90
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
91
+
92
+ new_options = opts.merge(
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: AssociationsApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
+ end
105
+ return data, status_code, headers
106
+ end
107
+
108
+ # Associate an object with another object
109
+ # @param object_type [String]
110
+ # @param object_id [String]
111
+ # @param to_object_type [String]
112
+ # @param to_object_id [String]
113
+ # @param association_type [String]
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [Boolean] :paginate_associations (default to false)
116
+ # @return [SimplePublicObject]
117
+ def create(object_type, object_id, to_object_type, to_object_id, association_type, opts = {})
118
+ data, _status_code, _headers = create_with_http_info(object_type, object_id, to_object_type, to_object_id, association_type, opts)
119
+ data
120
+ end
121
+
122
+ # Associate an object with another object
123
+ # @param object_type [String]
124
+ # @param object_id [String]
125
+ # @param to_object_type [String]
126
+ # @param to_object_id [String]
127
+ # @param association_type [String]
128
+ # @param [Hash] opts the optional parameters
129
+ # @option opts [Boolean] :paginate_associations
130
+ # @return [Array<(SimplePublicObject, Integer, Hash)>] SimplePublicObject data, response status code and response headers
131
+ def create_with_http_info(object_type, object_id, to_object_type, to_object_id, association_type, opts = {})
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug 'Calling API: AssociationsApi.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 AssociationsApi.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 AssociationsApi.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 AssociationsApi.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 AssociationsApi.create"
150
+ end
151
+ # verify the required parameter 'association_type' is set
152
+ if @api_client.config.client_side_validation && association_type.nil?
153
+ fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.create"
154
+ end
155
+ # resource path
156
+ local_var_path = '/crm/v3/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}/{associationType}'.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)).sub('{' + 'associationType' + '}', CGI.escape(association_type.to_s))
157
+
158
+ # query parameters
159
+ query_params = opts[:query_params] || {}
160
+ query_params[:'paginateAssociations'] = opts[:'paginate_associations'] if !opts[:'paginate_associations'].nil?
161
+
162
+ # header parameters
163
+ header_params = opts[:header_params] || {}
164
+ # HTTP header 'Accept' (if needed)
165
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
166
+
167
+ # form parameters
168
+ form_params = opts[:form_params] || {}
169
+
170
+ # http body (model)
171
+ post_body = opts[:body]
172
+
173
+ # return_type
174
+ return_type = opts[:return_type] || 'SimplePublicObject'
175
+
176
+ # auth_names
177
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
178
+
179
+ new_options = opts.merge(
180
+ :header_params => header_params,
181
+ :query_params => query_params,
182
+ :form_params => form_params,
183
+ :body => post_body,
184
+ :auth_names => auth_names,
185
+ :return_type => return_type
186
+ )
187
+
188
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
189
+ if @api_client.config.debugging
190
+ @api_client.config.logger.debug "API called: AssociationsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
191
+ end
192
+ return data, status_code, headers
193
+ end
194
+
195
+ # List associations of an object by type
196
+ # @param object_type [String]
197
+ # @param object_id [String]
198
+ # @param to_object_type [String]
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [Boolean] :paginate_associations (default to false)
201
+ # @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.
202
+ # @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
203
+ # @return [CollectionResponseAssociatedId]
204
+ def get_all(object_type, object_id, to_object_type, opts = {})
205
+ data, _status_code, _headers = get_all_with_http_info(object_type, object_id, to_object_type, opts)
206
+ data
207
+ end
208
+
209
+ # List associations of an object by type
210
+ # @param object_type [String]
211
+ # @param object_id [String]
212
+ # @param to_object_type [String]
213
+ # @param [Hash] opts the optional parameters
214
+ # @option opts [Boolean] :paginate_associations
215
+ # @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.
216
+ # @option opts [Integer] :limit The maximum number of results to display per page.
217
+ # @return [Array<(CollectionResponseAssociatedId, Integer, Hash)>] CollectionResponseAssociatedId data, response status code and response headers
218
+ def get_all_with_http_info(object_type, object_id, to_object_type, opts = {})
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug 'Calling API: AssociationsApi.get_all ...'
221
+ end
222
+ # verify the required parameter 'object_type' is set
223
+ if @api_client.config.client_side_validation && object_type.nil?
224
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling AssociationsApi.get_all"
225
+ end
226
+ # verify the required parameter 'object_id' is set
227
+ if @api_client.config.client_side_validation && object_id.nil?
228
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling AssociationsApi.get_all"
229
+ end
230
+ # verify the required parameter 'to_object_type' is set
231
+ if @api_client.config.client_side_validation && to_object_type.nil?
232
+ fail ArgumentError, "Missing the required parameter 'to_object_type' when calling AssociationsApi.get_all"
233
+ end
234
+ # resource path
235
+ local_var_path = '/crm/v3/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))
236
+
237
+ # query parameters
238
+ query_params = opts[:query_params] || {}
239
+ query_params[:'paginateAssociations'] = opts[:'paginate_associations'] if !opts[:'paginate_associations'].nil?
240
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
241
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
242
+
243
+ # header parameters
244
+ header_params = opts[:header_params] || {}
245
+ # HTTP header 'Accept' (if needed)
246
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
247
+
248
+ # form parameters
249
+ form_params = opts[:form_params] || {}
250
+
251
+ # http body (model)
252
+ post_body = opts[:body]
253
+
254
+ # return_type
255
+ return_type = opts[:return_type] || 'CollectionResponseAssociatedId'
256
+
257
+ # auth_names
258
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
259
+
260
+ new_options = opts.merge(
261
+ :header_params => header_params,
262
+ :query_params => query_params,
263
+ :form_params => form_params,
264
+ :body => post_body,
265
+ :auth_names => auth_names,
266
+ :return_type => return_type
267
+ )
268
+
269
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug "API called: AssociationsApi#get_all\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
+ end
273
+ return data, status_code, headers
274
+ end
275
+ end
276
+ end
277
+ end
278
+ end
@@ -0,0 +1,405 @@
1
+ =begin
2
+ #CRM Objects
3
+
4
+ #CRM objects such as companies, contacts, deals, line items, products, tickets, and quotes are standard objects in HubSpot’s CRM. These core building blocks support custom properties, store critical information, and play a central role in the HubSpot application. ## Supported Object Types This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the [CRM Object Properties API](https://developers.hubspot.com/docs/methods/crm-properties/crm-properties-overview). |Object Type |Properties returned by default | |--|--| | `companies` | `name`, `domain` | | `contacts` | `firstname`, `lastname`, `email` | | `deals` | `dealname`, `amount`, `closedate`, `pipeline`, `dealstage` | | `products` | `name`, `description`, `price` | | `tickets` | `content`, `hs_pipeline`, `hs_pipeline_stage`, `hs_ticket_category`, `hs_ticket_priority`, `subject` | Find a list of all properties for an object type using the [CRM Object Properties](https://developers.hubspot.com/docs/methods/crm-properties/get-properties) API. e.g. `GET https://api.hubapi.com/properties/v2/companies/properties`. Change the properties returned in the response using the `properties` array in the request body.
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 'cgi'
14
+
15
+ module Hubspot
16
+ module Crm
17
+ module Objects
18
+ class BasicApi
19
+ include Hubspot::Helpers::GetAllHelper
20
+
21
+ attr_accessor :api_client
22
+
23
+ def initialize(api_client = ApiClient.default)
24
+ @api_client = api_client
25
+ end
26
+ # Archive
27
+ # Move an Object identified by `{objectId}` to the recycling bin.
28
+ # @param object_type [String]
29
+ # @param object_id [String]
30
+ # @param [Hash] opts the optional parameters
31
+ # @return [nil]
32
+ def archive(object_type, object_id, opts = {})
33
+ archive_with_http_info(object_type, object_id, opts)
34
+ nil
35
+ end
36
+
37
+ # Archive
38
+ # Move an Object identified by &#x60;{objectId}&#x60; to the recycling bin.
39
+ # @param object_type [String]
40
+ # @param object_id [String]
41
+ # @param [Hash] opts the optional parameters
42
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
43
+ def archive_with_http_info(object_type, object_id, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: BasicApi.archive ...'
46
+ end
47
+ # verify the required parameter 'object_type' is set
48
+ if @api_client.config.client_side_validation && object_type.nil?
49
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.archive"
50
+ end
51
+ # verify the required parameter 'object_id' is set
52
+ if @api_client.config.client_side_validation && object_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling BasicApi.archive"
54
+ end
55
+ # resource path
56
+ local_var_path = '/crm/v3/objects/{objectType}/{objectId}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:body]
71
+
72
+ # return_type
73
+ return_type = opts[:return_type]
74
+
75
+ # auth_names
76
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
77
+
78
+ new_options = opts.merge(
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(:DELETE, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: BasicApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ return data, status_code, headers
92
+ end
93
+
94
+ # Create
95
+ # Create a CRM object with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard objects is provided.
96
+ # @param object_type [String]
97
+ # @param simple_public_object_input [SimplePublicObjectInput]
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [SimplePublicObject]
100
+ def create(object_type, simple_public_object_input, opts = {})
101
+ data, _status_code, _headers = create_with_http_info(object_type, simple_public_object_input, opts)
102
+ data
103
+ end
104
+
105
+ # Create
106
+ # Create a CRM object with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard objects is provided.
107
+ # @param object_type [String]
108
+ # @param simple_public_object_input [SimplePublicObjectInput]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(SimplePublicObject, Integer, Hash)>] SimplePublicObject data, response status code and response headers
111
+ def create_with_http_info(object_type, simple_public_object_input, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: BasicApi.create ...'
114
+ end
115
+ # verify the required parameter 'object_type' is set
116
+ if @api_client.config.client_side_validation && object_type.nil?
117
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.create"
118
+ end
119
+ # verify the required parameter 'simple_public_object_input' is set
120
+ if @api_client.config.client_side_validation && simple_public_object_input.nil?
121
+ fail ArgumentError, "Missing the required parameter 'simple_public_object_input' when calling BasicApi.create"
122
+ end
123
+ # resource path
124
+ local_var_path = '/crm/v3/objects/{objectType}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s))
125
+
126
+ # query parameters
127
+ query_params = opts[:query_params] || {}
128
+
129
+ # header parameters
130
+ header_params = opts[:header_params] || {}
131
+ # HTTP header 'Accept' (if needed)
132
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
133
+ # HTTP header 'Content-Type'
134
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
135
+
136
+ # form parameters
137
+ form_params = opts[:form_params] || {}
138
+
139
+ # http body (model)
140
+ post_body = opts[:body] || @api_client.object_to_http_body(simple_public_object_input)
141
+
142
+ # return_type
143
+ return_type = opts[:return_type] || 'SimplePublicObject'
144
+
145
+ # auth_names
146
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
147
+
148
+ new_options = opts.merge(
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => return_type
155
+ )
156
+
157
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "API called: BasicApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160
+ end
161
+ return data, status_code, headers
162
+ end
163
+
164
+ # Read
165
+ # Read an Object identified by `{objectId}`. `{objectId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.
166
+ # @param object_type [String]
167
+ # @param object_id [String]
168
+ # @param [Hash] opts the optional parameters
169
+ # @option opts [Array<String>] :properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.
170
+ # @option opts [Array<String>] :associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.
171
+ # @option opts [Boolean] :paginate_associations (default to false)
172
+ # @option opts [Boolean] :archived Whether to return only results that have been archived. (default to false)
173
+ # @option opts [String] :id_property The name of a property whose values are unique for this object type
174
+ # @return [SimplePublicObject]
175
+ def get_by_id(object_type, object_id, opts = {})
176
+ data, _status_code, _headers = get_by_id_with_http_info(object_type, object_id, opts)
177
+ data
178
+ end
179
+
180
+ # Read
181
+ # Read an Object identified by &#x60;{objectId}&#x60;. &#x60;{objectId}&#x60; refers to the internal object ID by default, or optionally any unique property value as specified by the &#x60;idProperty&#x60; query param. Control what is returned via the &#x60;properties&#x60; query param.
182
+ # @param object_type [String]
183
+ # @param object_id [String]
184
+ # @param [Hash] opts the optional parameters
185
+ # @option opts [Array<String>] :properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.
186
+ # @option opts [Array<String>] :associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.
187
+ # @option opts [Boolean] :paginate_associations
188
+ # @option opts [Boolean] :archived Whether to return only results that have been archived.
189
+ # @option opts [String] :id_property The name of a property whose values are unique for this object type
190
+ # @return [Array<(SimplePublicObject, Integer, Hash)>] SimplePublicObject data, response status code and response headers
191
+ def get_by_id_with_http_info(object_type, object_id, opts = {})
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug 'Calling API: BasicApi.get_by_id ...'
194
+ end
195
+ # verify the required parameter 'object_type' is set
196
+ if @api_client.config.client_side_validation && object_type.nil?
197
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.get_by_id"
198
+ end
199
+ # verify the required parameter 'object_id' is set
200
+ if @api_client.config.client_side_validation && object_id.nil?
201
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling BasicApi.get_by_id"
202
+ end
203
+ # resource path
204
+ local_var_path = '/crm/v3/objects/{objectType}/{objectId}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))
205
+
206
+ # query parameters
207
+ query_params = opts[:query_params] || {}
208
+ query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :multi) if !opts[:'properties'].nil?
209
+ query_params[:'associations'] = @api_client.build_collection_param(opts[:'associations'], :multi) if !opts[:'associations'].nil?
210
+ query_params[:'paginateAssociations'] = opts[:'paginate_associations'] if !opts[:'paginate_associations'].nil?
211
+ query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
212
+ query_params[:'idProperty'] = opts[:'id_property'] if !opts[:'id_property'].nil?
213
+
214
+ # header parameters
215
+ header_params = opts[:header_params] || {}
216
+ # HTTP header 'Accept' (if needed)
217
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
218
+
219
+ # form parameters
220
+ form_params = opts[:form_params] || {}
221
+
222
+ # http body (model)
223
+ post_body = opts[:body]
224
+
225
+ # return_type
226
+ return_type = opts[:return_type] || 'SimplePublicObject'
227
+
228
+ # auth_names
229
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
230
+
231
+ new_options = opts.merge(
232
+ :header_params => header_params,
233
+ :query_params => query_params,
234
+ :form_params => form_params,
235
+ :body => post_body,
236
+ :auth_names => auth_names,
237
+ :return_type => return_type
238
+ )
239
+
240
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: BasicApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+
247
+ # List
248
+ # Read a page of objects. Control what is returned via the `properties` query param.
249
+ # @param object_type [String]
250
+ # @param [Hash] opts the optional parameters
251
+ # @option opts [Integer] :limit The maximum number of results to display per page. (default to 10)
252
+ # @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.
253
+ # @option opts [Array<String>] :properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.
254
+ # @option opts [Array<String>] :associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.
255
+ # @option opts [Boolean] :paginate_associations (default to false)
256
+ # @option opts [Boolean] :archived Whether to return only results that have been archived. (default to false)
257
+ # @return [CollectionResponseSimplePublicObject]
258
+ def get_page(object_type, opts = {})
259
+ data, _status_code, _headers = get_page_with_http_info(object_type, opts)
260
+ data
261
+ end
262
+
263
+ # List
264
+ # Read a page of objects. Control what is returned via the &#x60;properties&#x60; query param.
265
+ # @param object_type [String]
266
+ # @param [Hash] opts the optional parameters
267
+ # @option opts [Integer] :limit The maximum number of results to display per page.
268
+ # @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.
269
+ # @option opts [Array<String>] :properties A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.
270
+ # @option opts [Array<String>] :associations A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.
271
+ # @option opts [Boolean] :paginate_associations
272
+ # @option opts [Boolean] :archived Whether to return only results that have been archived.
273
+ # @return [Array<(CollectionResponseSimplePublicObject, Integer, Hash)>] CollectionResponseSimplePublicObject data, response status code and response headers
274
+ def get_page_with_http_info(object_type, opts = {})
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug 'Calling API: BasicApi.get_page ...'
277
+ end
278
+ # verify the required parameter 'object_type' is set
279
+ if @api_client.config.client_side_validation && object_type.nil?
280
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.get_page"
281
+ end
282
+ # resource path
283
+ local_var_path = '/crm/v3/objects/{objectType}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s))
284
+
285
+ # query parameters
286
+ query_params = opts[:query_params] || {}
287
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
288
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
289
+ query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :multi) if !opts[:'properties'].nil?
290
+ query_params[:'associations'] = @api_client.build_collection_param(opts[:'associations'], :multi) if !opts[:'associations'].nil?
291
+ query_params[:'paginateAssociations'] = opts[:'paginate_associations'] if !opts[:'paginate_associations'].nil?
292
+ query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
293
+
294
+ # header parameters
295
+ header_params = opts[:header_params] || {}
296
+ # HTTP header 'Accept' (if needed)
297
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
298
+
299
+ # form parameters
300
+ form_params = opts[:form_params] || {}
301
+
302
+ # http body (model)
303
+ post_body = opts[:body]
304
+
305
+ # return_type
306
+ return_type = opts[:return_type] || 'CollectionResponseSimplePublicObject'
307
+
308
+ # auth_names
309
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
310
+
311
+ new_options = opts.merge(
312
+ :header_params => header_params,
313
+ :query_params => query_params,
314
+ :form_params => form_params,
315
+ :body => post_body,
316
+ :auth_names => auth_names,
317
+ :return_type => return_type
318
+ )
319
+
320
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
321
+ if @api_client.config.debugging
322
+ @api_client.config.logger.debug "API called: BasicApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
323
+ end
324
+ return data, status_code, headers
325
+ end
326
+
327
+ # Update
328
+ # Perform a partial update of an Object identified by `{objectId}`. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.
329
+ # @param object_type [String]
330
+ # @param object_id [String]
331
+ # @param simple_public_object_input [SimplePublicObjectInput]
332
+ # @param [Hash] opts the optional parameters
333
+ # @return [SimplePublicObject]
334
+ def update(object_type, object_id, simple_public_object_input, opts = {})
335
+ data, _status_code, _headers = update_with_http_info(object_type, object_id, simple_public_object_input, opts)
336
+ data
337
+ end
338
+
339
+ # Update
340
+ # Perform a partial update of an Object identified by &#x60;{objectId}&#x60;. Provided property values will be overwritten. Read-only and non-existent properties will be ignored. Properties values can be cleared by passing an empty string.
341
+ # @param object_type [String]
342
+ # @param object_id [String]
343
+ # @param simple_public_object_input [SimplePublicObjectInput]
344
+ # @param [Hash] opts the optional parameters
345
+ # @return [Array<(SimplePublicObject, Integer, Hash)>] SimplePublicObject data, response status code and response headers
346
+ def update_with_http_info(object_type, object_id, simple_public_object_input, opts = {})
347
+ if @api_client.config.debugging
348
+ @api_client.config.logger.debug 'Calling API: BasicApi.update ...'
349
+ end
350
+ # verify the required parameter 'object_type' is set
351
+ if @api_client.config.client_side_validation && object_type.nil?
352
+ fail ArgumentError, "Missing the required parameter 'object_type' when calling BasicApi.update"
353
+ end
354
+ # verify the required parameter 'object_id' is set
355
+ if @api_client.config.client_side_validation && object_id.nil?
356
+ fail ArgumentError, "Missing the required parameter 'object_id' when calling BasicApi.update"
357
+ end
358
+ # verify the required parameter 'simple_public_object_input' is set
359
+ if @api_client.config.client_side_validation && simple_public_object_input.nil?
360
+ fail ArgumentError, "Missing the required parameter 'simple_public_object_input' when calling BasicApi.update"
361
+ end
362
+ # resource path
363
+ local_var_path = '/crm/v3/objects/{objectType}/{objectId}'.sub('{' + 'objectType' + '}', CGI.escape(object_type.to_s)).sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))
364
+
365
+ # query parameters
366
+ query_params = opts[:query_params] || {}
367
+
368
+ # header parameters
369
+ header_params = opts[:header_params] || {}
370
+ # HTTP header 'Accept' (if needed)
371
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
372
+ # HTTP header 'Content-Type'
373
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
374
+
375
+ # form parameters
376
+ form_params = opts[:form_params] || {}
377
+
378
+ # http body (model)
379
+ post_body = opts[:body] || @api_client.object_to_http_body(simple_public_object_input)
380
+
381
+ # return_type
382
+ return_type = opts[:return_type] || 'SimplePublicObject'
383
+
384
+ # auth_names
385
+ auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
386
+
387
+ new_options = opts.merge(
388
+ :header_params => header_params,
389
+ :query_params => query_params,
390
+ :form_params => form_params,
391
+ :body => post_body,
392
+ :auth_names => auth_names,
393
+ :return_type => return_type
394
+ )
395
+
396
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
397
+ if @api_client.config.debugging
398
+ @api_client.config.logger.debug "API called: BasicApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
399
+ end
400
+ return data, status_code, headers
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end