hubspot-api-client 16.2.1 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/Gemfile.lock +1 -1
- data/README.md +33 -1
- data/lib/hubspot/codegen/crm/associations/v4/api/batch_api.rb +428 -0
- data/lib/hubspot/codegen/crm/associations/v4/api/definitions_api.rb +332 -0
- data/lib/hubspot/codegen/crm/associations/v4/api_client.rb +412 -0
- data/lib/hubspot/codegen/crm/associations/v4/api_error.rb +63 -0
- data/lib/hubspot/codegen/crm/associations/v4/configuration.rb +296 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_archive.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_association_multi_post.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_default_association_multi_post.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_input_public_fetch_associations_batch_request.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair.rb +328 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_labels_between_object_pair_with_errors.rb +348 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label.rb +328 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_association_multi_with_label_with_errors.rb +348 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/batch_response_public_default_association.rb +348 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/collection_response_association_spec_with_label_no_paging.rb +232 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/error.rb +307 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/error_category.rb +278 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/error_detail.rb +273 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/next_page.rb +239 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/paging.rb +234 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/previous_page.rb +239 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_create_request.rb +244 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_definition_update_request.rb +244 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_archive.rb +246 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_post.rb +260 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_association_multi_with_label.rb +255 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association.rb +258 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_default_association_multi_post.rb +244 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_fetch_associations_batch_request.rb +239 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/public_object_id.rb +230 -0
- data/lib/hubspot/codegen/crm/associations/v4/models/standard_error.rb +324 -0
- data/lib/hubspot/codegen/oauth/api/access_tokens_api.rb +0 -2
- data/lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb +5 -7
- data/lib/hubspot/codegen/oauth/api/tokens_api.rb +0 -2
- data/lib/hubspot/codegen/oauth/api_client.rb +0 -2
- data/lib/hubspot/codegen/oauth/api_error.rb +0 -2
- data/lib/hubspot/codegen/oauth/configuration.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/access_token_info_response.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/error.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/error_detail.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/refresh_token_info_response.rb +0 -2
- data/lib/hubspot/codegen/oauth/models/token_response_if.rb +31 -33
- data/lib/hubspot/discovery/crm/associations/client.rb +3 -1
- data/lib/hubspot/discovery/crm/associations/v4/api/batch_api.rb +15 -0
- data/lib/hubspot/discovery/crm/associations/v4/api/definitions_api.rb +15 -0
- data/lib/hubspot/discovery/crm/associations/v4/client.rb +21 -0
- data/lib/hubspot/version.rb +1 -1
- data/spec/discovery/cms/blogs/client_spec.rb +9 -0
- data/spec/discovery/cms/client_spec.rb +13 -0
- data/spec/discovery/crm/associations/client_spec.rb +7 -0
- data/spec/discovery/crm/associations/v4/batch_api_spec.rb +11 -0
- data/spec/discovery/crm/associations/v4/definitions_api_spec.rb +10 -0
- data/spec/discovery/crm/client_spec.rb +21 -0
- data/spec/discovery/crm/extensions/client_spec.rb +11 -0
- data/spec/discovery/crm/objects/client_spec.rb +13 -0
- data/spec/discovery/marketing/client_spec.rb +9 -0
- metadata +58 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2211099de3e655a7915522aee4c0c6f0bbb702acdd353325fad4a61b41a59e56
|
|
4
|
+
data.tar.gz: 78e814657a790aad731cb513f8562224f244d588b142eb498df80439219ff53b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63cb8acb0994a711e95051b589a7f4e173663ee2cd175671ce3d42887151d6cb82d0c1f2923f55d4225e4a3388849cb2bda6a508f3158a6301a2b051a3fefd83
|
|
7
|
+
data.tar.gz: ba7d80dcc5e4ccff59e182a1a0d66c3da202ca0c0e45436e75bbc048e83ea62ea3bef3d41822dcf03723cf3ee27df3c30051e600ac31664e20ef1a8be0e72943
|
data/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,16 @@ 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/v16.
|
|
8
|
+
## [Unreleased](https://github.com/HubSpot/hubspot-api-ruby/compare/v16.3.0...HEAD)
|
|
9
|
+
|
|
10
|
+
## [16.3.0] - 2023-02-21
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `crm.associations.v4` API client
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fix `auth.oauth.refresh_tokens_api.archive_refresh_token` method
|
|
9
18
|
|
|
10
19
|
|
|
11
20
|
## [16.2.1] - 2023-01-24
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -39,7 +39,7 @@ contacts = client.crm.contacts.basic_api.get_page
|
|
|
39
39
|
Please, note that hapikey is no longer supported after v13.1.0. You can get more info about hapikey sunset [here](https://developers.hubspot.com/changelog/upcoming-api-key-sunset). Also, plese, visit a [migration guide](https://developers.hubspot.com/docs/api/migrate-an-api-key-integration-to-a-private-app) if you need help with a migration process.
|
|
40
40
|
|
|
41
41
|
### Get all:
|
|
42
|
-
get_all method is available for all
|
|
42
|
+
`get_all` method is available for all objects (Companies, Contacts, Deals and etc).
|
|
43
43
|
|
|
44
44
|
```ruby
|
|
45
45
|
client = Hubspot::Client.new(access_token: 'your_oauth2_access_token')
|
|
@@ -50,6 +50,38 @@ You'll need to create a [private app](https://developers.hubspot.com/docs/api/pr
|
|
|
50
50
|
|
|
51
51
|
Please note that pagination is used under the hood to get all results.
|
|
52
52
|
|
|
53
|
+
## Search:
|
|
54
|
+
`do_search` method is available for all objects (Companies, Contacts, Deals and etc).
|
|
55
|
+
|
|
56
|
+
Only 3 `FilterGroups` with max 3 `Filters` are supported.
|
|
57
|
+
|
|
58
|
+
### Example search by date
|
|
59
|
+
```ruby
|
|
60
|
+
require 'hubspot-api-client'
|
|
61
|
+
require 'date'
|
|
62
|
+
|
|
63
|
+
api_client = Hubspot::Client.new(access_token: "YOUR_ACCESS_TOKEN")
|
|
64
|
+
# timestamp in milliseconds
|
|
65
|
+
timestamp = (DateTime.parse("XXXX-XX-XXTXX:XX:XX.XXXZ").to_time.to_f * 1000).to_i.to_s
|
|
66
|
+
body = {
|
|
67
|
+
"filterGroups":
|
|
68
|
+
[
|
|
69
|
+
{
|
|
70
|
+
"filters":[
|
|
71
|
+
{
|
|
72
|
+
"value": timestamp,
|
|
73
|
+
"propertyName":"lastmodifieddate",
|
|
74
|
+
"operator":"EQ"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
api_response = api_client.crm.contacts.search_api.do_search(
|
|
81
|
+
body: body
|
|
82
|
+
)
|
|
83
|
+
puts api_response
|
|
84
|
+
```
|
|
53
85
|
|
|
54
86
|
### Crm Object Schemas client usage:
|
|
55
87
|
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#CrmPublicAssociationsServiceV4
|
|
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 BatchApi
|
|
20
|
+
attr_accessor :api_client
|
|
21
|
+
|
|
22
|
+
def initialize(api_client = ApiClient.default)
|
|
23
|
+
@api_client = api_client
|
|
24
|
+
end
|
|
25
|
+
# Delete
|
|
26
|
+
# Batch delete associations for objects
|
|
27
|
+
# @param from_object_type [String]
|
|
28
|
+
# @param to_object_type [String]
|
|
29
|
+
# @param batch_input_public_association_multi_archive [BatchInputPublicAssociationMultiArchive]
|
|
30
|
+
# @param [Hash] opts the optional parameters
|
|
31
|
+
# @return [nil]
|
|
32
|
+
def archive(from_object_type, to_object_type, batch_input_public_association_multi_archive, opts = {})
|
|
33
|
+
archive_with_http_info(from_object_type, to_object_type, batch_input_public_association_multi_archive, opts)
|
|
34
|
+
nil
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Delete
|
|
38
|
+
# Batch delete associations for objects
|
|
39
|
+
# @param from_object_type [String]
|
|
40
|
+
# @param to_object_type [String]
|
|
41
|
+
# @param batch_input_public_association_multi_archive [BatchInputPublicAssociationMultiArchive]
|
|
42
|
+
# @param [Hash] opts the optional parameters
|
|
43
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
44
|
+
def archive_with_http_info(from_object_type, to_object_type, batch_input_public_association_multi_archive, opts = {})
|
|
45
|
+
if @api_client.config.debugging
|
|
46
|
+
@api_client.config.logger.debug 'Calling API: BatchApi.archive ...'
|
|
47
|
+
end
|
|
48
|
+
# verify the required parameter 'from_object_type' is set
|
|
49
|
+
if @api_client.config.client_side_validation && from_object_type.nil?
|
|
50
|
+
fail ArgumentError, "Missing the required parameter 'from_object_type' when calling BatchApi.archive"
|
|
51
|
+
end
|
|
52
|
+
# verify the required parameter 'to_object_type' is set
|
|
53
|
+
if @api_client.config.client_side_validation && to_object_type.nil?
|
|
54
|
+
fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BatchApi.archive"
|
|
55
|
+
end
|
|
56
|
+
# verify the required parameter 'batch_input_public_association_multi_archive' is set
|
|
57
|
+
if @api_client.config.client_side_validation && batch_input_public_association_multi_archive.nil?
|
|
58
|
+
fail ArgumentError, "Missing the required parameter 'batch_input_public_association_multi_archive' when calling BatchApi.archive"
|
|
59
|
+
end
|
|
60
|
+
# resource path
|
|
61
|
+
local_var_path = '/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/archive'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
|
|
62
|
+
|
|
63
|
+
# query parameters
|
|
64
|
+
query_params = opts[:query_params] || {}
|
|
65
|
+
|
|
66
|
+
# header parameters
|
|
67
|
+
header_params = opts[:header_params] || {}
|
|
68
|
+
# HTTP header 'Accept' (if needed)
|
|
69
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
|
70
|
+
# HTTP header 'Content-Type'
|
|
71
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
72
|
+
if !content_type.nil?
|
|
73
|
+
header_params['Content-Type'] = content_type
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# form parameters
|
|
77
|
+
form_params = opts[:form_params] || {}
|
|
78
|
+
|
|
79
|
+
# http body (model)
|
|
80
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_public_association_multi_archive)
|
|
81
|
+
|
|
82
|
+
# return_type
|
|
83
|
+
return_type = opts[:debug_return_type]
|
|
84
|
+
|
|
85
|
+
# auth_names
|
|
86
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
|
87
|
+
|
|
88
|
+
new_options = opts.merge(
|
|
89
|
+
:operation => :"BatchApi.archive",
|
|
90
|
+
:header_params => header_params,
|
|
91
|
+
:query_params => query_params,
|
|
92
|
+
:form_params => form_params,
|
|
93
|
+
:body => post_body,
|
|
94
|
+
:auth_names => auth_names,
|
|
95
|
+
:return_type => return_type
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug "API called: BatchApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
101
|
+
end
|
|
102
|
+
return data, status_code, headers
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Delete Specific Labels
|
|
106
|
+
# Batch delete specific association labels for objects. Deleting an unlabeled association will also delete all labeled associations between those two objects
|
|
107
|
+
# @param from_object_type [String]
|
|
108
|
+
# @param to_object_type [String]
|
|
109
|
+
# @param batch_input_public_association_multi_post [BatchInputPublicAssociationMultiPost]
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @return [nil]
|
|
112
|
+
def archive_labels(from_object_type, to_object_type, batch_input_public_association_multi_post, opts = {})
|
|
113
|
+
archive_labels_with_http_info(from_object_type, to_object_type, batch_input_public_association_multi_post, opts)
|
|
114
|
+
nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Delete Specific Labels
|
|
118
|
+
# Batch delete specific association labels for objects. Deleting an unlabeled association will also delete all labeled associations between those two objects
|
|
119
|
+
# @param from_object_type [String]
|
|
120
|
+
# @param to_object_type [String]
|
|
121
|
+
# @param batch_input_public_association_multi_post [BatchInputPublicAssociationMultiPost]
|
|
122
|
+
# @param [Hash] opts the optional parameters
|
|
123
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
124
|
+
def archive_labels_with_http_info(from_object_type, to_object_type, batch_input_public_association_multi_post, opts = {})
|
|
125
|
+
if @api_client.config.debugging
|
|
126
|
+
@api_client.config.logger.debug 'Calling API: BatchApi.archive_labels ...'
|
|
127
|
+
end
|
|
128
|
+
# verify the required parameter 'from_object_type' is set
|
|
129
|
+
if @api_client.config.client_side_validation && from_object_type.nil?
|
|
130
|
+
fail ArgumentError, "Missing the required parameter 'from_object_type' when calling BatchApi.archive_labels"
|
|
131
|
+
end
|
|
132
|
+
# verify the required parameter 'to_object_type' is set
|
|
133
|
+
if @api_client.config.client_side_validation && to_object_type.nil?
|
|
134
|
+
fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BatchApi.archive_labels"
|
|
135
|
+
end
|
|
136
|
+
# verify the required parameter 'batch_input_public_association_multi_post' is set
|
|
137
|
+
if @api_client.config.client_side_validation && batch_input_public_association_multi_post.nil?
|
|
138
|
+
fail ArgumentError, "Missing the required parameter 'batch_input_public_association_multi_post' when calling BatchApi.archive_labels"
|
|
139
|
+
end
|
|
140
|
+
# resource path
|
|
141
|
+
local_var_path = '/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/labels/archive'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
|
|
142
|
+
|
|
143
|
+
# query parameters
|
|
144
|
+
query_params = opts[:query_params] || {}
|
|
145
|
+
|
|
146
|
+
# header parameters
|
|
147
|
+
header_params = opts[:header_params] || {}
|
|
148
|
+
# HTTP header 'Accept' (if needed)
|
|
149
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
|
|
150
|
+
# HTTP header 'Content-Type'
|
|
151
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
152
|
+
if !content_type.nil?
|
|
153
|
+
header_params['Content-Type'] = content_type
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# form parameters
|
|
157
|
+
form_params = opts[:form_params] || {}
|
|
158
|
+
|
|
159
|
+
# http body (model)
|
|
160
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_public_association_multi_post)
|
|
161
|
+
|
|
162
|
+
# return_type
|
|
163
|
+
return_type = opts[:debug_return_type]
|
|
164
|
+
|
|
165
|
+
# auth_names
|
|
166
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
|
167
|
+
|
|
168
|
+
new_options = opts.merge(
|
|
169
|
+
:operation => :"BatchApi.archive_labels",
|
|
170
|
+
:header_params => header_params,
|
|
171
|
+
:query_params => query_params,
|
|
172
|
+
:form_params => form_params,
|
|
173
|
+
:body => post_body,
|
|
174
|
+
:auth_names => auth_names,
|
|
175
|
+
:return_type => return_type
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
179
|
+
if @api_client.config.debugging
|
|
180
|
+
@api_client.config.logger.debug "API called: BatchApi#archive_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
181
|
+
end
|
|
182
|
+
return data, status_code, headers
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Create
|
|
186
|
+
# Batch create associations for objects
|
|
187
|
+
# @param from_object_type [String]
|
|
188
|
+
# @param to_object_type [String]
|
|
189
|
+
# @param batch_input_public_association_multi_post [BatchInputPublicAssociationMultiPost]
|
|
190
|
+
# @param [Hash] opts the optional parameters
|
|
191
|
+
# @return [BatchResponseLabelsBetweenObjectPair]
|
|
192
|
+
def create(from_object_type, to_object_type, batch_input_public_association_multi_post, opts = {})
|
|
193
|
+
data, _status_code, _headers = create_with_http_info(from_object_type, to_object_type, batch_input_public_association_multi_post, opts)
|
|
194
|
+
data
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Create
|
|
198
|
+
# Batch create associations for objects
|
|
199
|
+
# @param from_object_type [String]
|
|
200
|
+
# @param to_object_type [String]
|
|
201
|
+
# @param batch_input_public_association_multi_post [BatchInputPublicAssociationMultiPost]
|
|
202
|
+
# @param [Hash] opts the optional parameters
|
|
203
|
+
# @return [Array<(BatchResponseLabelsBetweenObjectPair, Integer, Hash)>] BatchResponseLabelsBetweenObjectPair data, response status code and response headers
|
|
204
|
+
def create_with_http_info(from_object_type, to_object_type, batch_input_public_association_multi_post, opts = {})
|
|
205
|
+
if @api_client.config.debugging
|
|
206
|
+
@api_client.config.logger.debug 'Calling API: BatchApi.create ...'
|
|
207
|
+
end
|
|
208
|
+
# verify the required parameter 'from_object_type' is set
|
|
209
|
+
if @api_client.config.client_side_validation && from_object_type.nil?
|
|
210
|
+
fail ArgumentError, "Missing the required parameter 'from_object_type' when calling BatchApi.create"
|
|
211
|
+
end
|
|
212
|
+
# verify the required parameter 'to_object_type' is set
|
|
213
|
+
if @api_client.config.client_side_validation && to_object_type.nil?
|
|
214
|
+
fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BatchApi.create"
|
|
215
|
+
end
|
|
216
|
+
# verify the required parameter 'batch_input_public_association_multi_post' is set
|
|
217
|
+
if @api_client.config.client_side_validation && batch_input_public_association_multi_post.nil?
|
|
218
|
+
fail ArgumentError, "Missing the required parameter 'batch_input_public_association_multi_post' when calling BatchApi.create"
|
|
219
|
+
end
|
|
220
|
+
# resource path
|
|
221
|
+
local_var_path = '/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
|
|
222
|
+
|
|
223
|
+
# query parameters
|
|
224
|
+
query_params = opts[:query_params] || {}
|
|
225
|
+
|
|
226
|
+
# header parameters
|
|
227
|
+
header_params = opts[:header_params] || {}
|
|
228
|
+
# HTTP header 'Accept' (if needed)
|
|
229
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
230
|
+
# HTTP header 'Content-Type'
|
|
231
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
232
|
+
if !content_type.nil?
|
|
233
|
+
header_params['Content-Type'] = content_type
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# form parameters
|
|
237
|
+
form_params = opts[:form_params] || {}
|
|
238
|
+
|
|
239
|
+
# http body (model)
|
|
240
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_public_association_multi_post)
|
|
241
|
+
|
|
242
|
+
# return_type
|
|
243
|
+
return_type = opts[:debug_return_type] || 'BatchResponseLabelsBetweenObjectPair'
|
|
244
|
+
|
|
245
|
+
# auth_names
|
|
246
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
|
247
|
+
|
|
248
|
+
new_options = opts.merge(
|
|
249
|
+
:operation => :"BatchApi.create",
|
|
250
|
+
:header_params => header_params,
|
|
251
|
+
:query_params => query_params,
|
|
252
|
+
:form_params => form_params,
|
|
253
|
+
:body => post_body,
|
|
254
|
+
:auth_names => auth_names,
|
|
255
|
+
:return_type => return_type
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
259
|
+
if @api_client.config.debugging
|
|
260
|
+
@api_client.config.logger.debug "API called: BatchApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
261
|
+
end
|
|
262
|
+
return data, status_code, headers
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Create Default Associations
|
|
266
|
+
# Create the default (most generic) association type between two object types
|
|
267
|
+
# @param from_object_type [String]
|
|
268
|
+
# @param to_object_type [String]
|
|
269
|
+
# @param batch_input_public_default_association_multi_post [BatchInputPublicDefaultAssociationMultiPost]
|
|
270
|
+
# @param [Hash] opts the optional parameters
|
|
271
|
+
# @return [BatchResponsePublicDefaultAssociation]
|
|
272
|
+
def create_default(from_object_type, to_object_type, batch_input_public_default_association_multi_post, opts = {})
|
|
273
|
+
data, _status_code, _headers = create_default_with_http_info(from_object_type, to_object_type, batch_input_public_default_association_multi_post, opts)
|
|
274
|
+
data
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Create Default Associations
|
|
278
|
+
# Create the default (most generic) association type between two object types
|
|
279
|
+
# @param from_object_type [String]
|
|
280
|
+
# @param to_object_type [String]
|
|
281
|
+
# @param batch_input_public_default_association_multi_post [BatchInputPublicDefaultAssociationMultiPost]
|
|
282
|
+
# @param [Hash] opts the optional parameters
|
|
283
|
+
# @return [Array<(BatchResponsePublicDefaultAssociation, Integer, Hash)>] BatchResponsePublicDefaultAssociation data, response status code and response headers
|
|
284
|
+
def create_default_with_http_info(from_object_type, to_object_type, batch_input_public_default_association_multi_post, opts = {})
|
|
285
|
+
if @api_client.config.debugging
|
|
286
|
+
@api_client.config.logger.debug 'Calling API: BatchApi.create_default ...'
|
|
287
|
+
end
|
|
288
|
+
# verify the required parameter 'from_object_type' is set
|
|
289
|
+
if @api_client.config.client_side_validation && from_object_type.nil?
|
|
290
|
+
fail ArgumentError, "Missing the required parameter 'from_object_type' when calling BatchApi.create_default"
|
|
291
|
+
end
|
|
292
|
+
# verify the required parameter 'to_object_type' is set
|
|
293
|
+
if @api_client.config.client_side_validation && to_object_type.nil?
|
|
294
|
+
fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BatchApi.create_default"
|
|
295
|
+
end
|
|
296
|
+
# verify the required parameter 'batch_input_public_default_association_multi_post' is set
|
|
297
|
+
if @api_client.config.client_side_validation && batch_input_public_default_association_multi_post.nil?
|
|
298
|
+
fail ArgumentError, "Missing the required parameter 'batch_input_public_default_association_multi_post' when calling BatchApi.create_default"
|
|
299
|
+
end
|
|
300
|
+
# resource path
|
|
301
|
+
local_var_path = '/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/associate/default'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
|
|
302
|
+
|
|
303
|
+
# query parameters
|
|
304
|
+
query_params = opts[:query_params] || {}
|
|
305
|
+
|
|
306
|
+
# header parameters
|
|
307
|
+
header_params = opts[:header_params] || {}
|
|
308
|
+
# HTTP header 'Accept' (if needed)
|
|
309
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
310
|
+
# HTTP header 'Content-Type'
|
|
311
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
312
|
+
if !content_type.nil?
|
|
313
|
+
header_params['Content-Type'] = content_type
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# form parameters
|
|
317
|
+
form_params = opts[:form_params] || {}
|
|
318
|
+
|
|
319
|
+
# http body (model)
|
|
320
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_public_default_association_multi_post)
|
|
321
|
+
|
|
322
|
+
# return_type
|
|
323
|
+
return_type = opts[:debug_return_type] || 'BatchResponsePublicDefaultAssociation'
|
|
324
|
+
|
|
325
|
+
# auth_names
|
|
326
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
|
327
|
+
|
|
328
|
+
new_options = opts.merge(
|
|
329
|
+
:operation => :"BatchApi.create_default",
|
|
330
|
+
:header_params => header_params,
|
|
331
|
+
:query_params => query_params,
|
|
332
|
+
:form_params => form_params,
|
|
333
|
+
:body => post_body,
|
|
334
|
+
:auth_names => auth_names,
|
|
335
|
+
:return_type => return_type
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
339
|
+
if @api_client.config.debugging
|
|
340
|
+
@api_client.config.logger.debug "API called: BatchApi#create_default\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
341
|
+
end
|
|
342
|
+
return data, status_code, headers
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Read
|
|
346
|
+
# Batch read associations for objects to specific object type. The 'after' field in a returned paging object can be added alongside the 'id' to retrieve the next page of associations from that objectId. The 'link' field is deprecated and should be ignored.
|
|
347
|
+
# @param from_object_type [String]
|
|
348
|
+
# @param to_object_type [String]
|
|
349
|
+
# @param batch_input_public_fetch_associations_batch_request [BatchInputPublicFetchAssociationsBatchRequest]
|
|
350
|
+
# @param [Hash] opts the optional parameters
|
|
351
|
+
# @return [BatchResponsePublicAssociationMultiWithLabel]
|
|
352
|
+
def get_page(from_object_type, to_object_type, batch_input_public_fetch_associations_batch_request, opts = {})
|
|
353
|
+
data, _status_code, _headers = get_page_with_http_info(from_object_type, to_object_type, batch_input_public_fetch_associations_batch_request, opts)
|
|
354
|
+
data
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# Read
|
|
358
|
+
# Batch read associations for objects to specific object type. The 'after' field in a returned paging object can be added alongside the 'id' to retrieve the next page of associations from that objectId. The 'link' field is deprecated and should be ignored.
|
|
359
|
+
# @param from_object_type [String]
|
|
360
|
+
# @param to_object_type [String]
|
|
361
|
+
# @param batch_input_public_fetch_associations_batch_request [BatchInputPublicFetchAssociationsBatchRequest]
|
|
362
|
+
# @param [Hash] opts the optional parameters
|
|
363
|
+
# @return [Array<(BatchResponsePublicAssociationMultiWithLabel, Integer, Hash)>] BatchResponsePublicAssociationMultiWithLabel data, response status code and response headers
|
|
364
|
+
def get_page_with_http_info(from_object_type, to_object_type, batch_input_public_fetch_associations_batch_request, opts = {})
|
|
365
|
+
if @api_client.config.debugging
|
|
366
|
+
@api_client.config.logger.debug 'Calling API: BatchApi.get_page ...'
|
|
367
|
+
end
|
|
368
|
+
# verify the required parameter 'from_object_type' is set
|
|
369
|
+
if @api_client.config.client_side_validation && from_object_type.nil?
|
|
370
|
+
fail ArgumentError, "Missing the required parameter 'from_object_type' when calling BatchApi.get_page"
|
|
371
|
+
end
|
|
372
|
+
# verify the required parameter 'to_object_type' is set
|
|
373
|
+
if @api_client.config.client_side_validation && to_object_type.nil?
|
|
374
|
+
fail ArgumentError, "Missing the required parameter 'to_object_type' when calling BatchApi.get_page"
|
|
375
|
+
end
|
|
376
|
+
# verify the required parameter 'batch_input_public_fetch_associations_batch_request' is set
|
|
377
|
+
if @api_client.config.client_side_validation && batch_input_public_fetch_associations_batch_request.nil?
|
|
378
|
+
fail ArgumentError, "Missing the required parameter 'batch_input_public_fetch_associations_batch_request' when calling BatchApi.get_page"
|
|
379
|
+
end
|
|
380
|
+
# resource path
|
|
381
|
+
local_var_path = '/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/read'.sub('{' + 'fromObjectType' + '}', CGI.escape(from_object_type.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s))
|
|
382
|
+
|
|
383
|
+
# query parameters
|
|
384
|
+
query_params = opts[:query_params] || {}
|
|
385
|
+
|
|
386
|
+
# header parameters
|
|
387
|
+
header_params = opts[:header_params] || {}
|
|
388
|
+
# HTTP header 'Accept' (if needed)
|
|
389
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
|
390
|
+
# HTTP header 'Content-Type'
|
|
391
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
392
|
+
if !content_type.nil?
|
|
393
|
+
header_params['Content-Type'] = content_type
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# form parameters
|
|
397
|
+
form_params = opts[:form_params] || {}
|
|
398
|
+
|
|
399
|
+
# http body (model)
|
|
400
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_public_fetch_associations_batch_request)
|
|
401
|
+
|
|
402
|
+
# return_type
|
|
403
|
+
return_type = opts[:debug_return_type] || 'BatchResponsePublicAssociationMultiWithLabel'
|
|
404
|
+
|
|
405
|
+
# auth_names
|
|
406
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
|
407
|
+
|
|
408
|
+
new_options = opts.merge(
|
|
409
|
+
:operation => :"BatchApi.get_page",
|
|
410
|
+
:header_params => header_params,
|
|
411
|
+
:query_params => query_params,
|
|
412
|
+
:form_params => form_params,
|
|
413
|
+
:body => post_body,
|
|
414
|
+
:auth_names => auth_names,
|
|
415
|
+
:return_type => return_type
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
419
|
+
if @api_client.config.debugging
|
|
420
|
+
@api_client.config.logger.debug "API called: BatchApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
421
|
+
end
|
|
422
|
+
return data, status_code, headers
|
|
423
|
+
end
|
|
424
|
+
end
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
end
|