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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e5d57460bdda8cbf2fc666059e9395762d26202a84f30e056dbde2117f28724
4
- data.tar.gz: 7850afe9111512e550dc7ceb610e67f2cc9ce8615efef94fab894c98bfa2fb5a
3
+ metadata.gz: 11227912f653f47bd480fe26c8cb813d64399334c7b18784b57995258db92fe9
4
+ data.tar.gz: 5cb719e5e2a9f6706af63740cf270eb0c6fc30379e87897b90a03b8a1e0fec14
5
5
  SHA512:
6
- metadata.gz: 9e5adbb09e055024a83f888ddc2b3e5f9eab6d57d301297cf5b1c7a55833ba7a513af0fe9bc2da85637edb4fe3fad382484571c619c302a01a4874a175ddfa66
7
- data.tar.gz: bff167e47d455162d09a78883d866644cad52b00193150668177e32da752108ee532f520bf0781c5fb8af950e2093886a124cbb272c86c8065a1cd517d5e6e86
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hubspot-api-client (15.0.0)
4
+ hubspot-api-client (15.0.1)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.4.0)
7
7
 
@@ -23,14 +23,14 @@ module Hubspot
23
23
  end
24
24
 
25
25
  def api_client
26
- require_with_mapping "#{codegen_module_path}/api_client"
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
- require_with_mapping codegen_api_path.gsub(class_name, "api/#{class_name}")
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
- require_with_mapping "#{codegen_module_path}/configuration"
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 require_with_mapping(path)
54
- Hubspot::Helpers::Path.new.require_with_mapping(path)
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.require_with_mapping("#{codegen_module_path}/models/#{codegen_model}")
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
- require_with_mapping "#{codegen_module_path}/api_error"
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
- require_with_mapping "#{codegen_module_path}/models/#{param.to_s}"
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]
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module AuditLogs
7
7
  class AuditLogsApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('audit_logs/', 'audit-logs/')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -7,10 +7,6 @@ module Hubspot
7
7
  module BlogPosts
8
8
  class BlogPostsApi
9
9
  include Hubspot::Discovery::BaseApiClient
10
-
11
- def codegen_api_path
12
- super.gsub('blog_posts/', 'blog-posts/')
13
- end
14
10
  end
15
11
  end
16
12
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module SiteSearch
7
7
  class PublicApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('site_search', 'site-search')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module SourceCode
7
7
  class ContentApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('source_code', 'source-code')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module SourceCode
7
7
  class ExtractApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('source_code', 'source-code')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module SourceCode
7
7
  class MetadataApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('source_code', 'source-code')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module SourceCode
7
7
  class SourceCodeExtractApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('source_code/', 'source-code/')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module SourceCode
7
7
  class ValidationApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('source_code', 'source-code')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module UrlRedirects
7
7
  class RedirectsApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('url_redirects', 'url-redirects')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -6,10 +6,6 @@ module Hubspot
6
6
  module VisitorIdentification
7
7
  class GenerateApi
8
8
  include Hubspot::Discovery::BaseApiClient
9
-
10
- def codegen_api_path
11
- super.gsub('visitor_identification', 'visitor-identification')
12
- end
13
9
  end
14
10
  end
15
11
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Hubspot
2
- VERSION = '15.0.0'
2
+ VERSION = '15.0.1'
3
3
  end
@@ -6,7 +6,7 @@ describe 'Hubspot::Discovery::BaseApiClient' do
6
6
  class Hubspot::Discovery::SomeApiClass
7
7
  include Hubspot::Discovery::BaseApiClient
8
8
 
9
- def require_with_mapping(path)
9
+ def require_codegen(path)
10
10
  path
11
11
  end
12
12
  end
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.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-13 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus