hubspot-api-client 15.0.0 → 15.0.2
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 -0
- data/Gemfile.lock +12 -12
- data/lib/hubspot/discovery/base_api_client.rb +23 -9
- data/lib/hubspot/discovery/cms/audit_logs/api/audit_logs_api.rb +0 -4
- data/lib/hubspot/discovery/cms/blogs/blog_posts/api/blog_posts_api.rb +0 -4
- data/lib/hubspot/discovery/cms/site_search/api/public_api.rb +0 -4
- data/lib/hubspot/discovery/cms/source_code/api/content_api.rb +0 -4
- data/lib/hubspot/discovery/cms/source_code/api/extract_api.rb +0 -4
- data/lib/hubspot/discovery/cms/source_code/api/metadata_api.rb +0 -4
- data/lib/hubspot/discovery/cms/source_code/api/source_code_extract_api.rb +0 -4
- data/lib/hubspot/discovery/cms/source_code/api/validation_api.rb +0 -4
- data/lib/hubspot/discovery/cms/url_redirects/api/redirects_api.rb +0 -4
- data/lib/hubspot/discovery/conversations/visitor_identification/api/generate_api.rb +0 -4
- data/lib/hubspot/helpers/path.rb +11 -0
- data/lib/hubspot/version.rb +1 -1
- data/spec/discovery/base_api_client_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4e2a40b9546a8237be6d5ad839b82641882db1e52c432de3266df0faead2314
|
4
|
+
data.tar.gz: 70e8a203d740012fdf15be014f1acbe0cb7c3e3d7f4fc51bbb90833d4b471744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a19797f24e9cf9ebe7d8c1c462211a7128be75222ea66ffb5f8b7767e8b946f635d6d4f2bf66a5b52373f5905cf4c73b62592702523ccd0b2660264ccfeface
|
7
|
+
data.tar.gz: 32a4bbbd501d66b2a2be7e5214c9c99cdd37ad4483e809ca74fb88a2490cec71eb871d6198dd6b07f7e931b5c79ad1af7ce36be750c457bfaf28b8b38895f6a7
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +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
|
+
## [15.0.2] - 2022-11-04
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- pass params with snake case
|
12
|
+
|
13
|
+
## [15.0.1] - 2022-10-17
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
- codegen path mapping for requiring models
|
17
|
+
|
8
18
|
## [15.0.0] - 2022-10-12
|
9
19
|
### Changed
|
10
20
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hubspot-api-client (15.0.
|
4
|
+
hubspot-api-client (15.0.2)
|
5
5
|
json (~> 2.1, >= 2.1.0)
|
6
6
|
typhoeus (~> 1.4.0)
|
7
7
|
|
@@ -33,19 +33,19 @@ GEM
|
|
33
33
|
rake-release (1.3.0)
|
34
34
|
bundler (>= 1.11, < 3)
|
35
35
|
rexml (3.2.5)
|
36
|
-
rspec (3.
|
37
|
-
rspec-core (~> 3.
|
38
|
-
rspec-expectations (~> 3.
|
39
|
-
rspec-mocks (~> 3.
|
40
|
-
rspec-core (3.
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-expectations (3.
|
36
|
+
rspec (3.12.0)
|
37
|
+
rspec-core (~> 3.12.0)
|
38
|
+
rspec-expectations (~> 3.12.0)
|
39
|
+
rspec-mocks (~> 3.12.0)
|
40
|
+
rspec-core (3.12.0)
|
41
|
+
rspec-support (~> 3.12.0)
|
42
|
+
rspec-expectations (3.12.0)
|
43
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-mocks (3.
|
44
|
+
rspec-support (~> 3.12.0)
|
45
|
+
rspec-mocks (3.12.0)
|
46
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.
|
48
|
-
rspec-support (3.
|
47
|
+
rspec-support (~> 3.12.0)
|
48
|
+
rspec-support (3.12.0)
|
49
49
|
typhoeus (1.4.0)
|
50
50
|
ethon (>= 0.9.0)
|
51
51
|
vcr (3.0.3)
|
@@ -23,14 +23,14 @@ module Hubspot
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def api_client
|
26
|
-
|
26
|
+
require_codegen "#{codegen_module_path}/api_client"
|
27
27
|
require_api_error
|
28
28
|
@api_client ||= Kernel.const_get( "#{codegen_module_name}::ApiClient").new(config)
|
29
29
|
end
|
30
30
|
|
31
31
|
def api
|
32
32
|
class_name = codegen_api_path.gsub(/(.*)\/(.*)/, '\2')
|
33
|
-
|
33
|
+
require_codegen codegen_api_path.gsub(class_name, "api/#{class_name}")
|
34
34
|
require_api_models
|
35
35
|
@api ||= Kernel.const_get(codegen_api_class).new(api_client)
|
36
36
|
end
|
@@ -42,7 +42,7 @@ module Hubspot
|
|
42
42
|
private
|
43
43
|
|
44
44
|
def new_config
|
45
|
-
|
45
|
+
require_codegen "#{codegen_module_path}/configuration"
|
46
46
|
config = Kernel.const_get("#{codegen_module_name}::Configuration").new
|
47
47
|
config.access_token = base_params[:access_token] if base_params[:access_token]
|
48
48
|
config.api_key['hapikey'] = base_params[:api_key] if base_params[:api_key]
|
@@ -50,8 +50,8 @@ module Hubspot
|
|
50
50
|
config
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
Hubspot::Helpers::Path.new.
|
53
|
+
def require_codegen(path)
|
54
|
+
Hubspot::Helpers::Path.new.require_with_codegen_mapping(path)
|
55
55
|
end
|
56
56
|
|
57
57
|
def require_api_models
|
@@ -59,7 +59,7 @@ module Hubspot
|
|
59
59
|
require 'hubspot/helpers/path'
|
60
60
|
codegen_module_path = Hubspot::Helpers::Path.new.format(self.name).gsub('hubspot/', 'hubspot/codegen/')
|
61
61
|
codegen_model = Hubspot::Helpers::Path.new.format(const)
|
62
|
-
Hubspot::Helpers::Path.new.
|
62
|
+
Hubspot::Helpers::Path.new.require_with_codegen_mapping("#{codegen_module_path}/models/#{codegen_model}")
|
63
63
|
super
|
64
64
|
rescue LoadError
|
65
65
|
super
|
@@ -67,7 +67,7 @@ module Hubspot
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def require_api_error
|
70
|
-
|
70
|
+
require_codegen "#{codegen_module_path}/api_error"
|
71
71
|
end
|
72
72
|
|
73
73
|
def codegen_api_class
|
@@ -124,6 +124,19 @@ module Hubspot
|
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
|
+
def convert_body(body)
|
128
|
+
converted_body = {}
|
129
|
+
body.each do |key, value|
|
130
|
+
camel_case_key = Hubspot::Helpers::CamelCase.new.format(key.to_s)
|
131
|
+
camel_case_key = camel_case_key[0, 1].downcase + camel_case_key[1..-1]
|
132
|
+
converted_value = value
|
133
|
+
converted_value = convert_body(value) if value.is_a?(Hash)
|
134
|
+
converted_value = value.map { |elem| elem.is_a?(Hash) ? convert_body(elem) : elem } if value.is_a?(Array)
|
135
|
+
converted_body[camel_case_key.to_sym] = converted_value
|
136
|
+
end
|
137
|
+
converted_body
|
138
|
+
end
|
139
|
+
|
127
140
|
def define_methods
|
128
141
|
define_api_methods
|
129
142
|
end
|
@@ -153,8 +166,9 @@ module Hubspot
|
|
153
166
|
params_to_pass = signature_params.map do |req, param|
|
154
167
|
if params_with_defaults[param].nil?
|
155
168
|
model_name = Hubspot::Helpers::CamelCase.new.format(param.to_s)
|
156
|
-
|
157
|
-
|
169
|
+
require_codegen "#{codegen_module_path}/models/#{param.to_s}"
|
170
|
+
converted_body = convert_body(params_with_defaults[:body])
|
171
|
+
Kernel.const_get("#{codegen_module_name}::#{model_name}").build_from_hash(converted_body)
|
158
172
|
else
|
159
173
|
params_with_defaults[param]
|
160
174
|
end
|
data/lib/hubspot/helpers/path.rb
CHANGED
@@ -10,6 +10,17 @@ module Hubspot
|
|
10
10
|
def require_with_mapping(path)
|
11
11
|
require path.gsub('o_auth', 'oauth')
|
12
12
|
end
|
13
|
+
|
14
|
+
def require_with_codegen_mapping(path)
|
15
|
+
require path
|
16
|
+
.gsub('o_auth', 'oauth')
|
17
|
+
.gsub('audit_logs/', 'audit-logs/')
|
18
|
+
.gsub('blog_posts/', 'blog-posts/')
|
19
|
+
.gsub('site_search', 'site-search')
|
20
|
+
.gsub('source_code/', 'source-code/')
|
21
|
+
.gsub('url_redirects', 'url-redirects')
|
22
|
+
.gsub('visitor_identification', 'visitor-identification')
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
data/lib/hubspot/version.rb
CHANGED
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: 15.0.
|
4
|
+
version: 15.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HubSpot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|