hubspot-api-client 15.0.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11227912f653f47bd480fe26c8cb813d64399334c7b18784b57995258db92fe9
4
- data.tar.gz: 5cb719e5e2a9f6706af63740cf270eb0c6fc30379e87897b90a03b8a1e0fec14
3
+ metadata.gz: a4e2a40b9546a8237be6d5ad839b82641882db1e52c432de3266df0faead2314
4
+ data.tar.gz: 70e8a203d740012fdf15be014f1acbe0cb7c3e3d7f4fc51bbb90833d4b471744
5
5
  SHA512:
6
- metadata.gz: 64ac2669a18235dc7976475c98d0364cb70f93ff44e0bd65510bf158b9bcc9d55406fa3975fd18af72d9169d2d0440caf2ba14739772b6a3f4e924ad4557c984
7
- data.tar.gz: 88db3ce60f71ea9bae05f821a81b0097c34d7c0d7866d55e017666218a209b176caf87fc026ae5bec9d82c554584c419655daf66e84d0f3666e79b5ed64eaf7c
6
+ metadata.gz: 9a19797f24e9cf9ebe7d8c1c462211a7128be75222ea66ffb5f8b7767e8b946f635d6d4f2bf66a5b52373f5905cf4c73b62592702523ccd0b2660264ccfeface
7
+ data.tar.gz: 32a4bbbd501d66b2a2be7e5214c9c99cdd37ad4483e809ca74fb88a2490cec71eb871d6198dd6b07f7e931b5c79ad1af7ce36be750c457bfaf28b8b38895f6a7
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.2] - 2022-11-04
9
+ ### Fixed
10
+
11
+ - pass params with snake case
12
+
8
13
  ## [15.0.1] - 2022-10-17
9
14
  ### Fixed
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.1)
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.11.0)
37
- rspec-core (~> 3.11.0)
38
- rspec-expectations (~> 3.11.0)
39
- rspec-mocks (~> 3.11.0)
40
- rspec-core (3.11.0)
41
- rspec-support (~> 3.11.0)
42
- rspec-expectations (3.11.1)
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.11.0)
45
- rspec-mocks (3.11.1)
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.11.0)
48
- rspec-support (3.11.1)
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)
@@ -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
@@ -154,7 +167,8 @@ module Hubspot
154
167
  if params_with_defaults[param].nil?
155
168
  model_name = Hubspot::Helpers::CamelCase.new.format(param.to_s)
156
169
  require_codegen "#{codegen_module_path}/models/#{param.to_s}"
157
- Kernel.const_get("#{codegen_module_name}::#{model_name}").build_from_hash(params_with_defaults[:body])
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
@@ -1,3 +1,3 @@
1
1
  module Hubspot
2
- VERSION = '15.0.1'
2
+ VERSION = '15.0.2'
3
3
  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.1
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-10-17 00:00:00.000000000 Z
11
+ date: 2022-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus