hubspot-api-client 15.0.0 → 15.0.1
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 +5 -0
- data/Gemfile.lock +1 -1
- data/lib/hubspot/discovery/base_api_client.rb +8 -8
- 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: 11227912f653f47bd480fe26c8cb813d64399334c7b18784b57995258db92fe9
|
4
|
+
data.tar.gz: 5cb719e5e2a9f6706af63740cf270eb0c6fc30379e87897b90a03b8a1e0fec14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64ac2669a18235dc7976475c98d0364cb70f93ff44e0bd65510bf158b9bcc9d55406fa3975fd18af72d9169d2d0440caf2ba14739772b6a3f4e924ad4557c984
|
7
|
+
data.tar.gz: 88db3ce60f71ea9bae05f821a81b0097c34d7c0d7866d55e017666218a209b176caf87fc026ae5bec9d82c554584c419655daf66e84d0f3666e79b5ed64eaf7c
|
data/CHANGELOG.md
CHANGED
@@ -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
|
+
## [15.0.1] - 2022-10-17
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- codegen path mapping for requiring models
|
12
|
+
|
8
13
|
## [15.0.0] - 2022-10-12
|
9
14
|
### Changed
|
10
15
|
|
data/Gemfile.lock
CHANGED
@@ -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
|
@@ -153,7 +153,7 @@ module Hubspot
|
|
153
153
|
params_to_pass = signature_params.map do |req, param|
|
154
154
|
if params_with_defaults[param].nil?
|
155
155
|
model_name = Hubspot::Helpers::CamelCase.new.format(param.to_s)
|
156
|
-
|
156
|
+
require_codegen "#{codegen_module_path}/models/#{param.to_s}"
|
157
157
|
Kernel.const_get("#{codegen_module_name}::#{model_name}").build_from_hash(params_with_defaults[:body])
|
158
158
|
else
|
159
159
|
params_with_defaults[param]
|
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HubSpot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|