hubspot-api-client 16.0.3 → 16.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +1 -1
- data/lib/hubspot/codegen/cms/domains/api/domains_api.rb +2 -2
- data/lib/hubspot/codegen/cms/domains/configuration.rb +7 -0
- data/lib/hubspot/codegen/crm/companies/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/companies/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/companies/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/companies/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/companies/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/companies/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/crm/contacts/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/contacts/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/contacts/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/contacts/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/contacts/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/contacts/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/crm/deals/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/deals/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/deals/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/deals/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/deals/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/deals/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/crm/imports/api/core_api.rb +2 -2
- data/lib/hubspot/codegen/crm/imports/api/public_imports_api.rb +1 -1
- data/lib/hubspot/codegen/crm/imports/models/import_row_core.rb +34 -18
- data/lib/hubspot/codegen/crm/imports/models/public_import_error.rb +19 -19
- data/lib/hubspot/codegen/crm/imports/models/public_import_response.rb +2 -2
- data/lib/hubspot/codegen/crm/line_items/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/line_items/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/line_items/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/line_items/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/line_items/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/line_items/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/crm/objects/calls/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/objects/calls/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/objects/calls/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/objects/calls/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/calls/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/objects/calls/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/objects/emails/api/associations_api.rb +48 -43
- data/lib/hubspot/codegen/crm/objects/emails/api/basic_api.rb +2 -2
- data/lib/hubspot/codegen/crm/objects/emails/api/batch_api.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/emails/api/search_api.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/emails/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/objects/emails/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/objects/emails/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/emails/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/objects/emails/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/objects/meetings/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/objects/meetings/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/objects/meetings/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/objects/meetings/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/meetings/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/objects/meetings/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/objects/notes/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/objects/notes/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/objects/notes/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/objects/notes/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/notes/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/objects/notes/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/objects/tasks/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/objects/tasks/models/association_spec.rb +278 -0
- data/lib/hubspot/codegen/crm/objects/tasks/models/association_spec_with_label.rb +287 -0
- data/lib/hubspot/codegen/crm/objects/tasks/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/objects/tasks/models/labels_between_object_pair.rb +288 -0
- data/lib/hubspot/codegen/crm/objects/tasks/models/multi_associated_object_with_label.rb +246 -0
- data/lib/hubspot/codegen/crm/products/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/products/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/products/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/products/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/products/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/products/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/crm/quotes/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/quotes/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/quotes/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/quotes/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/quotes/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/quotes/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/crm/tickets/api/associations_api.rb +47 -42
- data/lib/hubspot/codegen/crm/tickets/models/association_spec.rb +276 -0
- data/lib/hubspot/codegen/crm/tickets/models/association_spec_with_label.rb +285 -0
- data/lib/hubspot/codegen/crm/tickets/models/{collection_response_associated_id_forward_paging.rb → collection_response_multi_associated_object_with_label_forward_paging.rb} +4 -4
- data/lib/hubspot/codegen/crm/tickets/models/labels_between_object_pair.rb +286 -0
- data/lib/hubspot/codegen/crm/tickets/models/multi_associated_object_with_label.rb +244 -0
- data/lib/hubspot/codegen/marketing/events/api/attendance_subscriber_state_changes_api.rb +2 -2
- data/lib/hubspot/codegen/marketing/events/api/marketing_events_external_api.rb +12 -12
- data/lib/hubspot/version.rb +1 -1
- metadata +68 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8204da9cda81deddc0e84762accf9428dc794cf0164b9f1e34008ebc04f39ac
|
4
|
+
data.tar.gz: 6a9e42f140a5598203c427d7f262eff8cd7482fedd562a8898e3f6284b9b503b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5146fdebcceeb22af4ca68028ad99aa1f31e17a53908cc6b4c7051b882a45ff2a31353ea78b4d6a90957e775a440a5601ce76016e37bda14b7d156a4a89bac3b
|
7
|
+
data.tar.gz: 71f6717ff5bbcc6af9c43006ffb942906d624ec15b040059f1fd34963bdb97c7b0516765af796059acea0aa13cd563dc355269a121de8e9b77be7eacc865c37e
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,20 @@ 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
|
+
## [16.0.4] - 2022-12-08
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Added Private App access token to (
|
12
|
+
- cms.domains
|
13
|
+
- crm.imports
|
14
|
+
- crm.objects.emals
|
15
|
+
- marketing.events
|
16
|
+
)
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Fix all association APIs
|
21
|
+
|
8
22
|
## [16.0.3] - 2022-11-23
|
9
23
|
### Changed
|
10
24
|
|
data/Gemfile.lock
CHANGED
@@ -65,7 +65,7 @@ module Hubspot
|
|
65
65
|
return_type = opts[:debug_return_type] || 'Domain'
|
66
66
|
|
67
67
|
# auth_names
|
68
|
-
auth_names = opts[:debug_auth_names] || ['hapikey']
|
68
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
69
69
|
|
70
70
|
new_options = opts.merge(
|
71
71
|
:operation => :"DomainsApi.get_by_id",
|
@@ -152,7 +152,7 @@ module Hubspot
|
|
152
152
|
return_type = opts[:debug_return_type] || 'CollectionResponseWithTotalDomainForwardPaging'
|
153
153
|
|
154
154
|
# auth_names
|
155
|
-
auth_names = opts[:debug_auth_names] || ['hapikey']
|
155
|
+
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
156
156
|
|
157
157
|
new_options = opts.merge(
|
158
158
|
:operation => :"DomainsApi.get_page",
|
@@ -21,26 +21,26 @@ module Hubspot
|
|
21
21
|
def initialize(api_client = ApiClient.default)
|
22
22
|
@api_client = api_client
|
23
23
|
end
|
24
|
-
#
|
25
|
-
#
|
24
|
+
# Delete
|
25
|
+
# deletes all associations between two records.
|
26
|
+
# @param company_id [Integer]
|
26
27
|
# @param to_object_type [String]
|
27
|
-
# @param to_object_id [
|
28
|
-
# @param association_type [String]
|
28
|
+
# @param to_object_id [Integer]
|
29
29
|
# @param [Hash] opts the optional parameters
|
30
30
|
# @return [nil]
|
31
|
-
def archive(company_id, to_object_type, to_object_id,
|
32
|
-
archive_with_http_info(company_id, to_object_type, to_object_id,
|
31
|
+
def archive(company_id, to_object_type, to_object_id, opts = {})
|
32
|
+
archive_with_http_info(company_id, to_object_type, to_object_id, opts)
|
33
33
|
nil
|
34
34
|
end
|
35
35
|
|
36
|
-
#
|
37
|
-
#
|
36
|
+
# Delete
|
37
|
+
# deletes all associations between two records.
|
38
|
+
# @param company_id [Integer]
|
38
39
|
# @param to_object_type [String]
|
39
|
-
# @param to_object_id [
|
40
|
-
# @param association_type [String]
|
40
|
+
# @param to_object_id [Integer]
|
41
41
|
# @param [Hash] opts the optional parameters
|
42
42
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
43
|
-
def archive_with_http_info(company_id, to_object_type, to_object_id,
|
43
|
+
def archive_with_http_info(company_id, to_object_type, to_object_id, opts = {})
|
44
44
|
if @api_client.config.debugging
|
45
45
|
@api_client.config.logger.debug 'Calling API: AssociationsApi.archive ...'
|
46
46
|
end
|
@@ -56,12 +56,8 @@ module Hubspot
|
|
56
56
|
if @api_client.config.client_side_validation && to_object_id.nil?
|
57
57
|
fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.archive"
|
58
58
|
end
|
59
|
-
# verify the required parameter 'association_type' is set
|
60
|
-
if @api_client.config.client_side_validation && association_type.nil?
|
61
|
-
fail ArgumentError, "Missing the required parameter 'association_type' when calling AssociationsApi.archive"
|
62
|
-
end
|
63
59
|
# resource path
|
64
|
-
local_var_path = '/crm/v4/objects/companies/{companyId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'companyId' + '}', CGI.escape(company_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
|
60
|
+
local_var_path = '/crm/v4/objects/companies/{companyId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'companyId' + '}', CGI.escape(company_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
|
65
61
|
|
66
62
|
# query parameters
|
67
63
|
query_params = opts[:query_params] || {}
|
@@ -100,26 +96,28 @@ module Hubspot
|
|
100
96
|
return data, status_code, headers
|
101
97
|
end
|
102
98
|
|
103
|
-
#
|
104
|
-
#
|
99
|
+
# Create
|
100
|
+
# Set association labels between two records.
|
101
|
+
# @param company_id [Integer]
|
105
102
|
# @param to_object_type [String]
|
106
|
-
# @param to_object_id [
|
107
|
-
# @param
|
103
|
+
# @param to_object_id [Integer]
|
104
|
+
# @param association_spec [Array<AssociationSpec>]
|
108
105
|
# @param [Hash] opts the optional parameters
|
109
|
-
# @return [
|
110
|
-
def create(company_id, to_object_type, to_object_id,
|
111
|
-
data, _status_code, _headers = create_with_http_info(company_id, to_object_type, to_object_id,
|
106
|
+
# @return [LabelsBetweenObjectPair]
|
107
|
+
def create(company_id, to_object_type, to_object_id, association_spec, opts = {})
|
108
|
+
data, _status_code, _headers = create_with_http_info(company_id, to_object_type, to_object_id, association_spec, opts)
|
112
109
|
data
|
113
110
|
end
|
114
111
|
|
115
|
-
#
|
116
|
-
#
|
112
|
+
# Create
|
113
|
+
# Set association labels between two records.
|
114
|
+
# @param company_id [Integer]
|
117
115
|
# @param to_object_type [String]
|
118
|
-
# @param to_object_id [
|
119
|
-
# @param
|
116
|
+
# @param to_object_id [Integer]
|
117
|
+
# @param association_spec [Array<AssociationSpec>]
|
120
118
|
# @param [Hash] opts the optional parameters
|
121
|
-
# @return [Array<(
|
122
|
-
def create_with_http_info(company_id, to_object_type, to_object_id,
|
119
|
+
# @return [Array<(LabelsBetweenObjectPair, Integer, Hash)>] LabelsBetweenObjectPair data, response status code and response headers
|
120
|
+
def create_with_http_info(company_id, to_object_type, to_object_id, association_spec, opts = {})
|
123
121
|
if @api_client.config.debugging
|
124
122
|
@api_client.config.logger.debug 'Calling API: AssociationsApi.create ...'
|
125
123
|
end
|
@@ -135,12 +133,12 @@ module Hubspot
|
|
135
133
|
if @api_client.config.client_side_validation && to_object_id.nil?
|
136
134
|
fail ArgumentError, "Missing the required parameter 'to_object_id' when calling AssociationsApi.create"
|
137
135
|
end
|
138
|
-
# verify the required parameter '
|
139
|
-
if @api_client.config.client_side_validation &&
|
140
|
-
fail ArgumentError, "Missing the required parameter '
|
136
|
+
# verify the required parameter 'association_spec' is set
|
137
|
+
if @api_client.config.client_side_validation && association_spec.nil?
|
138
|
+
fail ArgumentError, "Missing the required parameter 'association_spec' when calling AssociationsApi.create"
|
141
139
|
end
|
142
140
|
# resource path
|
143
|
-
local_var_path = '/crm/v4/objects/companies/{companyId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'companyId' + '}', CGI.escape(company_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
|
141
|
+
local_var_path = '/crm/v4/objects/companies/{companyId}/associations/{toObjectType}/{toObjectId}'.sub('{' + 'companyId' + '}', CGI.escape(company_id.to_s)).sub('{' + 'toObjectType' + '}', CGI.escape(to_object_type.to_s)).sub('{' + 'toObjectId' + '}', CGI.escape(to_object_id.to_s))
|
144
142
|
|
145
143
|
# query parameters
|
146
144
|
query_params = opts[:query_params] || {}
|
@@ -149,15 +147,20 @@ module Hubspot
|
|
149
147
|
header_params = opts[:header_params] || {}
|
150
148
|
# HTTP header 'Accept' (if needed)
|
151
149
|
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
|
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
|
152
155
|
|
153
156
|
# form parameters
|
154
157
|
form_params = opts[:form_params] || {}
|
155
158
|
|
156
159
|
# http body (model)
|
157
|
-
post_body = opts[:debug_body]
|
160
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(association_spec)
|
158
161
|
|
159
162
|
# return_type
|
160
|
-
return_type = opts[:debug_return_type] || '
|
163
|
+
return_type = opts[:debug_return_type] || 'LabelsBetweenObjectPair'
|
161
164
|
|
162
165
|
# auth_names
|
163
166
|
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
@@ -179,25 +182,27 @@ module Hubspot
|
|
179
182
|
return data, status_code, headers
|
180
183
|
end
|
181
184
|
|
182
|
-
# List
|
183
|
-
#
|
185
|
+
# List
|
186
|
+
# List all associations of a company by object type. Limit 1000 per call.
|
187
|
+
# @param company_id [Integer]
|
184
188
|
# @param to_object_type [String]
|
185
189
|
# @param [Hash] opts the optional parameters
|
186
190
|
# @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
|
187
191
|
# @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
|
188
|
-
# @return [
|
192
|
+
# @return [CollectionResponseMultiAssociatedObjectWithLabelForwardPaging]
|
189
193
|
def get_all(company_id, to_object_type, opts = {})
|
190
194
|
data, _status_code, _headers = get_all_with_http_info(company_id, to_object_type, opts)
|
191
195
|
data
|
192
196
|
end
|
193
197
|
|
194
|
-
# List
|
195
|
-
#
|
198
|
+
# List
|
199
|
+
# List all associations of a company by object type. Limit 1000 per call.
|
200
|
+
# @param company_id [Integer]
|
196
201
|
# @param to_object_type [String]
|
197
202
|
# @param [Hash] opts the optional parameters
|
198
203
|
# @option opts [String] :after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
|
199
204
|
# @option opts [Integer] :limit The maximum number of results to display per page. (default to 500)
|
200
|
-
# @return [Array<(
|
205
|
+
# @return [Array<(CollectionResponseMultiAssociatedObjectWithLabelForwardPaging, Integer, Hash)>] CollectionResponseMultiAssociatedObjectWithLabelForwardPaging data, response status code and response headers
|
201
206
|
def get_all_with_http_info(company_id, to_object_type, opts = {})
|
202
207
|
if @api_client.config.debugging
|
203
208
|
@api_client.config.logger.debug 'Calling API: AssociationsApi.get_all ...'
|
@@ -230,7 +235,7 @@ module Hubspot
|
|
230
235
|
post_body = opts[:debug_body]
|
231
236
|
|
232
237
|
# return_type
|
233
|
-
return_type = opts[:debug_return_type] || '
|
238
|
+
return_type = opts[:debug_return_type] || 'CollectionResponseMultiAssociatedObjectWithLabelForwardPaging'
|
234
239
|
|
235
240
|
# auth_names
|
236
241
|
auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']
|
@@ -0,0 +1,276 @@
|
|
1
|
+
=begin
|
2
|
+
#Companies
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.2.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Hubspot
|
17
|
+
module Crm
|
18
|
+
module Companies
|
19
|
+
class AssociationSpec
|
20
|
+
attr_accessor :association_category
|
21
|
+
|
22
|
+
attr_accessor :association_type_id
|
23
|
+
|
24
|
+
class EnumAttributeValidator
|
25
|
+
attr_reader :datatype
|
26
|
+
attr_reader :allowable_values
|
27
|
+
|
28
|
+
def initialize(datatype, allowable_values)
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
30
|
+
case datatype.to_s
|
31
|
+
when /Integer/i
|
32
|
+
value.to_i
|
33
|
+
when /Float/i
|
34
|
+
value.to_f
|
35
|
+
else
|
36
|
+
value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def valid?(value)
|
42
|
+
!value || allowable_values.include?(value)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:'association_category' => :'associationCategory',
|
50
|
+
:'association_type_id' => :'associationTypeId'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns all the JSON keys this model knows about
|
55
|
+
def self.acceptable_attributes
|
56
|
+
attribute_map.values
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.openapi_types
|
61
|
+
{
|
62
|
+
:'association_category' => :'String',
|
63
|
+
:'association_type_id' => :'Integer'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Crm::Companies::AssociationSpec` initialize method"
|
78
|
+
end
|
79
|
+
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Crm::Companies::AssociationSpec`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
87
|
+
|
88
|
+
if attributes.key?(:'association_category')
|
89
|
+
self.association_category = attributes[:'association_category']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'association_type_id')
|
93
|
+
self.association_type_id = attributes[:'association_type_id']
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
98
|
+
# @return Array for valid properties with the reasons
|
99
|
+
def list_invalid_properties
|
100
|
+
invalid_properties = Array.new
|
101
|
+
if @association_category.nil?
|
102
|
+
invalid_properties.push('invalid value for "association_category", association_category cannot be nil.')
|
103
|
+
end
|
104
|
+
|
105
|
+
if @association_type_id.nil?
|
106
|
+
invalid_properties.push('invalid value for "association_type_id", association_type_id cannot be nil.')
|
107
|
+
end
|
108
|
+
|
109
|
+
invalid_properties
|
110
|
+
end
|
111
|
+
|
112
|
+
# Check to see if the all the properties in the model are valid
|
113
|
+
# @return true if the model is valid
|
114
|
+
def valid?
|
115
|
+
return false if @association_category.nil?
|
116
|
+
association_category_validator = EnumAttributeValidator.new('String', ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"])
|
117
|
+
return false unless association_category_validator.valid?(@association_category)
|
118
|
+
return false if @association_type_id.nil?
|
119
|
+
true
|
120
|
+
end
|
121
|
+
|
122
|
+
# Custom attribute writer method checking allowed values (enum).
|
123
|
+
# @param [Object] association_category Object to be assigned
|
124
|
+
def association_category=(association_category)
|
125
|
+
validator = EnumAttributeValidator.new('String', ["HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED"])
|
126
|
+
unless validator.valid?(association_category)
|
127
|
+
fail ArgumentError, "invalid value for \"association_category\", must be one of #{validator.allowable_values}."
|
128
|
+
end
|
129
|
+
@association_category = association_category
|
130
|
+
end
|
131
|
+
|
132
|
+
# Checks equality by comparing each attribute.
|
133
|
+
# @param [Object] Object to be compared
|
134
|
+
def ==(o)
|
135
|
+
return true if self.equal?(o)
|
136
|
+
self.class == o.class &&
|
137
|
+
association_category == o.association_category &&
|
138
|
+
association_type_id == o.association_type_id
|
139
|
+
end
|
140
|
+
|
141
|
+
# @see the `==` method
|
142
|
+
# @param [Object] Object to be compared
|
143
|
+
def eql?(o)
|
144
|
+
self == o
|
145
|
+
end
|
146
|
+
|
147
|
+
# Calculates hash code according to all attributes.
|
148
|
+
# @return [Integer] Hash code
|
149
|
+
def hash
|
150
|
+
[association_category, association_type_id].hash
|
151
|
+
end
|
152
|
+
|
153
|
+
# Builds the object from hash
|
154
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
155
|
+
# @return [Object] Returns the model itself
|
156
|
+
def self.build_from_hash(attributes)
|
157
|
+
new.build_from_hash(attributes)
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def build_from_hash(attributes)
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
165
|
+
attributes = attributes.transform_keys(&:to_sym)
|
166
|
+
self.class.openapi_types.each_pair do |key, type|
|
167
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
168
|
+
self.send("#{key}=", nil)
|
169
|
+
elsif type =~ /\AArray<(.*)>/i
|
170
|
+
# check to ensure the input is an array given that the attribute
|
171
|
+
# is documented as an array but the input is not
|
172
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
173
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
174
|
+
end
|
175
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
176
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
self
|
181
|
+
end
|
182
|
+
|
183
|
+
# Deserializes the data based on type
|
184
|
+
# @param string type Data type
|
185
|
+
# @param string value Value to be deserialized
|
186
|
+
# @return [Object] Deserialized data
|
187
|
+
def _deserialize(type, value)
|
188
|
+
case type.to_sym
|
189
|
+
when :Time
|
190
|
+
Time.parse(value)
|
191
|
+
when :Date
|
192
|
+
Date.parse(value)
|
193
|
+
when :String
|
194
|
+
value.to_s
|
195
|
+
when :Integer
|
196
|
+
value.to_i
|
197
|
+
when :Float
|
198
|
+
value.to_f
|
199
|
+
when :Boolean
|
200
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
201
|
+
true
|
202
|
+
else
|
203
|
+
false
|
204
|
+
end
|
205
|
+
when :Object
|
206
|
+
# generic object (usually a Hash), return directly
|
207
|
+
value
|
208
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
209
|
+
inner_type = Regexp.last_match[:inner_type]
|
210
|
+
value.map { |v| _deserialize(inner_type, v) }
|
211
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
212
|
+
k_type = Regexp.last_match[:k_type]
|
213
|
+
v_type = Regexp.last_match[:v_type]
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each do |k, v|
|
216
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
else # model
|
220
|
+
# models (e.g. Pet) or oneOf
|
221
|
+
klass = Hubspot::Crm::Companies.const_get(type)
|
222
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# Returns the string representation of the object
|
227
|
+
# @return [String] String presentation of the object
|
228
|
+
def to_s
|
229
|
+
to_hash.to_s
|
230
|
+
end
|
231
|
+
|
232
|
+
# to_body is an alias to to_hash (backward compatibility)
|
233
|
+
# @return [Hash] Returns the object in the form of hash
|
234
|
+
def to_body
|
235
|
+
to_hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Returns the object in the form of hash
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
240
|
+
def to_hash
|
241
|
+
hash = {}
|
242
|
+
self.class.attribute_map.each_pair do |attr, param|
|
243
|
+
value = self.send(attr)
|
244
|
+
if value.nil?
|
245
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
246
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
247
|
+
end
|
248
|
+
|
249
|
+
hash[param] = _to_hash(value)
|
250
|
+
end
|
251
|
+
hash
|
252
|
+
end
|
253
|
+
|
254
|
+
# Outputs non-array value in the form of hash
|
255
|
+
# For object, use to_hash. Otherwise, just return the value
|
256
|
+
# @param [Object] value Any valid value
|
257
|
+
# @return [Hash] Returns the value in the form of hash
|
258
|
+
def _to_hash(value)
|
259
|
+
if value.is_a?(Array)
|
260
|
+
value.compact.map { |v| _to_hash(v) }
|
261
|
+
elsif value.is_a?(Hash)
|
262
|
+
{}.tap do |hash|
|
263
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
264
|
+
end
|
265
|
+
elsif value.respond_to? :to_hash
|
266
|
+
value.to_hash
|
267
|
+
else
|
268
|
+
value
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
end
|
273
|
+
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|