hubspot-api-client 13.2.0 → 14.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/Gemfile.lock +5 -5
- data/hubspot-api-client.gemspec +1 -1
- data/lib/hubspot/client.rb +0 -18
- data/lib/hubspot/codegen/automation/actions/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/audit-logs/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/blogs/authors/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/blogs/blog-posts/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/blogs/tags/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/domains/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/hubdb/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/performance/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/site-search/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/source-code/api_error.rb +1 -1
- data/lib/hubspot/codegen/cms/url-redirects/api_error.rb +1 -1
- data/lib/hubspot/codegen/communication_preferences/api_error.rb +1 -1
- data/lib/hubspot/codegen/conversations/visitor-identification/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/associations/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/companies/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/contacts/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/deals/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/extensions/accounting/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/extensions/calling/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/extensions/cards/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/extensions/videoconferencing/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/imports/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/line_items/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/calls/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/emails/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/associations_api.rb +3 -3
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/basic_api.rb +5 -5
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/batch_api.rb +4 -4
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/public_object_api.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api/search_api.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/feedback_submissions/configuration.rb +7 -0
- data/lib/hubspot/codegen/crm/objects/meetings/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/notes/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/objects/tasks/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/owners/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/pipelines/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/products/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/properties/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/quotes/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/schemas/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/tickets/api_error.rb +1 -1
- data/lib/hubspot/codegen/crm/timeline/api_error.rb +1 -1
- data/lib/hubspot/codegen/events/api_error.rb +1 -1
- data/lib/hubspot/codegen/files/files/api_error.rb +1 -1
- data/lib/hubspot/codegen/marketing/events/api_error.rb +1 -1
- data/lib/hubspot/codegen/marketing/forms/api_error.rb +1 -1
- data/lib/hubspot/codegen/marketing/transactional/api_error.rb +1 -1
- data/lib/hubspot/codegen/oauth/api_error.rb +1 -1
- data/lib/hubspot/codegen/settings/users/api_error.rb +1 -1
- data/lib/hubspot/codegen/webhooks/api_error.rb +1 -1
- data/lib/hubspot/discovery/base_api_client.rb +14 -2
- data/lib/hubspot/version.rb +1 -1
- data/spec/discovery/base_api_client_spec.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4cf7152f7d94654ae7efaef840fc2232392091973642e5b6a877358d665c687
|
4
|
+
data.tar.gz: 7f9b630bc30d894300a8317f170583c1179684f3915f50055821e63fe892bcb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a22483996355e355ca0efe55b88d83a66f704936920a64287c05e175a9348a1039acdf6652f3811a380a31c6aceda9be648768b25e9e807035e3e051b1699ba
|
7
|
+
data.tar.gz: 4ba24e78d4f838a817c96a8bd8b3681809d50a2a886dab6b078090423239421794917b79de0eb17e8bfe91b735ac4bfa42a3e66633bef5dfeebb760d98c02cc0
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [14.2.0] - 2022-08-25
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- using new separate configurations for Hubspot::Client
|
12
|
+
|
13
|
+
## [14.1.0] - 2022-08-23
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- using default ruby StandardError
|
17
|
+
|
18
|
+
## [14.0.0] - 2022-08-11
|
19
|
+
### Changed
|
20
|
+
|
21
|
+
- required ruby version was increased to 2.7
|
22
|
+
|
8
23
|
## [13.2.0] - 2022-08-09
|
9
24
|
### Changed
|
10
25
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hubspot-api-client (
|
4
|
+
hubspot-api-client (14.2.0)
|
5
5
|
json (~> 2.1, >= 2.1.0)
|
6
6
|
require_all (~> 3.0.0)
|
7
7
|
typhoeus (~> 1.4.0)
|
@@ -10,8 +10,8 @@ GEM
|
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
ZenTest (4.12.1)
|
13
|
-
addressable (2.8.
|
14
|
-
public_suffix (>= 2.0.2, <
|
13
|
+
addressable (2.8.1)
|
14
|
+
public_suffix (>= 2.0.2, < 6.0)
|
15
15
|
autotest (4.4.6)
|
16
16
|
ZenTest (>= 4.4.1)
|
17
17
|
autotest-growl (0.2.16)
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
pry (0.14.1)
|
30
30
|
coderay (~> 1.1)
|
31
31
|
method_source (~> 1.0)
|
32
|
-
public_suffix (
|
32
|
+
public_suffix (5.0.0)
|
33
33
|
rake (12.3.3)
|
34
34
|
rake-release (1.3.0)
|
35
35
|
bundler (>= 1.11, < 3)
|
@@ -51,7 +51,7 @@ GEM
|
|
51
51
|
typhoeus (1.4.0)
|
52
52
|
ethon (>= 0.9.0)
|
53
53
|
vcr (3.0.3)
|
54
|
-
webmock (3.
|
54
|
+
webmock (3.18.1)
|
55
55
|
addressable (>= 2.8.0)
|
56
56
|
crack (>= 0.3.2)
|
57
57
|
hashdiff (>= 0.4.0, < 2.0.0)
|
data/hubspot-api-client.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = "HubSpot Ruby API Gem"
|
12
12
|
s.description = "HubSpot Ruby API client"
|
13
13
|
s.license = "Apache-2.0"
|
14
|
-
s.required_ruby_version = ">=
|
14
|
+
s.required_ruby_version = ">= 2.7"
|
15
15
|
|
16
16
|
s.add_runtime_dependency 'typhoeus', '~> 1.4.0'
|
17
17
|
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
data/lib/hubspot/client.rb
CHANGED
@@ -2,8 +2,6 @@ require_rel 'discovery'
|
|
2
2
|
|
3
3
|
module Hubspot
|
4
4
|
class Client
|
5
|
-
attr_reader :api_key, :access_token
|
6
|
-
|
7
5
|
def self.api_modules
|
8
6
|
%i[
|
9
7
|
automation
|
@@ -28,25 +26,9 @@ module Hubspot
|
|
28
26
|
'Hubspot::Discovery'
|
29
27
|
end
|
30
28
|
|
31
|
-
def configure_api_key
|
32
|
-
Hubspot.configure do |config|
|
33
|
-
config.api_key['hapikey'] = api_key
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def configure_access_token
|
38
|
-
Hubspot.configure do |config|
|
39
|
-
config.access_token = access_token
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
29
|
def initialize(params)
|
44
30
|
raise 'Please, pass :api_key or :access_token' if params[:api_key].nil? && params[:developer_api_key].nil? && params[:access_token].nil?
|
45
|
-
@api_key = params[:api_key] || params[:developer_api_key]
|
46
|
-
@access_token = params[:access_token]
|
47
31
|
@params = params
|
48
|
-
configure_api_key if @api_key
|
49
|
-
configure_access_token if @access_token
|
50
32
|
end
|
51
33
|
end
|
52
34
|
end
|
@@ -82,7 +82,7 @@ module Hubspot
|
|
82
82
|
return_type = opts[:return_type]
|
83
83
|
|
84
84
|
# auth_names
|
85
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
85
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
86
86
|
|
87
87
|
new_options = opts.merge(
|
88
88
|
:header_params => header_params,
|
@@ -160,7 +160,7 @@ module Hubspot
|
|
160
160
|
return_type = opts[:return_type] || 'SimplePublicObjectWithAssociations'
|
161
161
|
|
162
162
|
# auth_names
|
163
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
163
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
164
164
|
|
165
165
|
new_options = opts.merge(
|
166
166
|
:header_params => header_params,
|
@@ -232,7 +232,7 @@ module Hubspot
|
|
232
232
|
return_type = opts[:return_type] || 'CollectionResponseAssociatedIdForwardPaging'
|
233
233
|
|
234
234
|
# auth_names
|
235
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
235
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
236
236
|
|
237
237
|
new_options = opts.merge(
|
238
238
|
:header_params => header_params,
|
@@ -68,7 +68,7 @@ module Hubspot
|
|
68
68
|
return_type = opts[:return_type]
|
69
69
|
|
70
70
|
# auth_names
|
71
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
71
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
72
72
|
|
73
73
|
new_options = opts.merge(
|
74
74
|
:header_params => header_params,
|
@@ -132,7 +132,7 @@ module Hubspot
|
|
132
132
|
return_type = opts[:return_type] || 'SimplePublicObject'
|
133
133
|
|
134
134
|
# auth_names
|
135
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
135
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
136
136
|
|
137
137
|
new_options = opts.merge(
|
138
138
|
:header_params => header_params,
|
@@ -209,7 +209,7 @@ module Hubspot
|
|
209
209
|
return_type = opts[:return_type] || 'SimplePublicObjectWithAssociations'
|
210
210
|
|
211
211
|
# auth_names
|
212
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
212
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
213
213
|
|
214
214
|
new_options = opts.merge(
|
215
215
|
:header_params => header_params,
|
@@ -283,7 +283,7 @@ module Hubspot
|
|
283
283
|
return_type = opts[:return_type] || 'CollectionResponseSimplePublicObjectWithAssociationsForwardPaging'
|
284
284
|
|
285
285
|
# auth_names
|
286
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
286
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
287
287
|
|
288
288
|
new_options = opts.merge(
|
289
289
|
:header_params => header_params,
|
@@ -356,7 +356,7 @@ module Hubspot
|
|
356
356
|
return_type = opts[:return_type] || 'SimplePublicObject'
|
357
357
|
|
358
358
|
# auth_names
|
359
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
359
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
360
360
|
|
361
361
|
new_options = opts.merge(
|
362
362
|
:header_params => header_params,
|
@@ -66,7 +66,7 @@ module Hubspot
|
|
66
66
|
return_type = opts[:return_type]
|
67
67
|
|
68
68
|
# auth_names
|
69
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
69
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
70
70
|
|
71
71
|
new_options = opts.merge(
|
72
72
|
:header_params => header_params,
|
@@ -128,7 +128,7 @@ module Hubspot
|
|
128
128
|
return_type = opts[:return_type] || 'BatchResponseSimplePublicObject'
|
129
129
|
|
130
130
|
# auth_names
|
131
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
131
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
132
132
|
|
133
133
|
new_options = opts.merge(
|
134
134
|
:header_params => header_params,
|
@@ -193,7 +193,7 @@ module Hubspot
|
|
193
193
|
return_type = opts[:return_type] || 'BatchResponseSimplePublicObject'
|
194
194
|
|
195
195
|
# auth_names
|
196
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
196
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
197
197
|
|
198
198
|
new_options = opts.merge(
|
199
199
|
:header_params => header_params,
|
@@ -255,7 +255,7 @@ module Hubspot
|
|
255
255
|
return_type = opts[:return_type] || 'BatchResponseSimplePublicObject'
|
256
256
|
|
257
257
|
# auth_names
|
258
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
258
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
259
259
|
|
260
260
|
new_options = opts.merge(
|
261
261
|
:header_params => header_params,
|
@@ -66,7 +66,7 @@ module Hubspot
|
|
66
66
|
return_type = opts[:return_type] || 'SimplePublicObject'
|
67
67
|
|
68
68
|
# auth_names
|
69
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
69
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
70
70
|
|
71
71
|
new_options = opts.merge(
|
72
72
|
:header_params => header_params,
|
@@ -64,7 +64,7 @@ module Hubspot
|
|
64
64
|
return_type = opts[:return_type] || 'CollectionResponseWithTotalSimplePublicObjectForwardPaging'
|
65
65
|
|
66
66
|
# auth_names
|
67
|
-
auth_names = opts[:auth_names] || ['hapikey']
|
67
|
+
auth_names = opts[:auth_names] || ['hapikey', 'oauth2']
|
68
68
|
|
69
69
|
new_options = opts.merge(
|
70
70
|
:header_params => header_params,
|
@@ -12,12 +12,16 @@ module Hubspot
|
|
12
12
|
api.methods.grep(/with_http_info/).map {|elem| elem.to_s.gsub('_with_http_info', '').to_sym }
|
13
13
|
end
|
14
14
|
|
15
|
+
def config
|
16
|
+
@config ||= new_config
|
17
|
+
end
|
18
|
+
|
15
19
|
def api_client
|
16
|
-
|
20
|
+
@api_client ||= Kernel.const_get("#{self.class.name.gsub('Discovery::', '').gsub(/(.*)::.*/, '\1')}::ApiClient").new(config)
|
17
21
|
end
|
18
22
|
|
19
23
|
def api
|
20
|
-
@api ||= Kernel.const_get(codegen_api_class).new
|
24
|
+
@api ||= Kernel.const_get(codegen_api_class).new(api_client)
|
21
25
|
end
|
22
26
|
|
23
27
|
def get_all(params = {})
|
@@ -26,6 +30,14 @@ module Hubspot
|
|
26
30
|
|
27
31
|
private
|
28
32
|
|
33
|
+
def new_config
|
34
|
+
config = Kernel.const_get("#{self.class.name.gsub('Discovery::', '').gsub(/(.*)::.*/, '\1')}::Configuration").new
|
35
|
+
config.access_token = base_params[:access_token] if base_params[:access_token]
|
36
|
+
config.api_key['hapikey'] = base_params[:api_key] if base_params[:api_key]
|
37
|
+
config.api_key['hapikey'] = base_params[:developer_api_key] if base_params[:developer_api_key]
|
38
|
+
config
|
39
|
+
end
|
40
|
+
|
29
41
|
def codegen_api_class
|
30
42
|
self.class.name.gsub('Discovery::', '')
|
31
43
|
end
|
data/lib/hubspot/version.rb
CHANGED
@@ -6,6 +6,9 @@ describe 'Hubspot::Discovery::BaseApiClient' do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class Hubspot::SomeApiClass
|
9
|
+
def initialize(api_client)
|
10
|
+
end
|
11
|
+
|
9
12
|
def get(test_id, opts = {})
|
10
13
|
"got test_id: #{test_id}, opts: #{opts}"
|
11
14
|
end
|
@@ -21,6 +24,11 @@ describe 'Hubspot::Discovery::BaseApiClient' do
|
|
21
24
|
end
|
22
25
|
end
|
23
26
|
|
27
|
+
class Hubspot::ApiClient
|
28
|
+
def initialize(config)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
24
32
|
subject(:client) { Hubspot::Discovery::SomeApiClass.new(access_token: 'test') }
|
25
33
|
let(:api) { client.api }
|
26
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubspot-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 14.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HubSpot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -2843,7 +2843,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2843
2843
|
requirements:
|
2844
2844
|
- - ">="
|
2845
2845
|
- !ruby/object:Gem::Version
|
2846
|
-
version: '
|
2846
|
+
version: '2.7'
|
2847
2847
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2848
2848
|
requirements:
|
2849
2849
|
- - ">="
|