bing_ads_ruby_sdk 1.6 → 1.7

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: 10064130886df96745297db7c95d5482b3127563383425554e7ee722e36e17ff
4
- data.tar.gz: ffd8833ecabc68e2d6ac7760891399070bbffb6f644f79b7f71275270e5e9c95
3
+ metadata.gz: 9ba09362c0df0c63b729b31a627ddd6708a1b187c37f392002471c4c05d6e448
4
+ data.tar.gz: 34db7cac452be374d8e4d305752b0fb5e0db09834710d17a718809c37733b3a7
5
5
  SHA512:
6
- metadata.gz: 5dad795cb0dba423784ad86926c397740b083201bfb9c327f04763e94f34149860d857989b2e1386008ed19d96317a9ea91655b1267f39017b32fd14d34b9388
7
- data.tar.gz: b5d31b8cd1fad4f64b91debaead3daf4878d427b5d5d17639247e732eedc125a406d16968a1dd5a3d1fc4402059268d5cffa05ee6a0c96ae153836246f232154
6
+ metadata.gz: 62ee362cbad60084db481253ea12e7baf3203773dffb59c2a47c6831cd6add07c15e489f1e4b1aa87ed2a488eb19d718dcf232237ee11062f5da91f727217368
7
+ data.tar.gz: 7c89d9dc0508449d20e14263534658115d1736f3a2cd7e82ac54dc0274a954228929296795f0c6098e1c95f3a868ff47beb12eb34090cf3ef4adeb7ec8c98e2b
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in bing_ads_ruby_sdk.gemspec
4
4
  gemspec
5
5
 
6
- gem "standard", "1.31.1"
6
+ gem "standard", "1.41.1"
data/changelog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## V1.7 Release
2
+ - Fixed a bug preventing all but the first ad extension associations to be fetched
3
+ - All error messages are now returned instead of just the first one
4
+ - Updated dependencies
5
+
1
6
  ## V1.6 Release
2
7
  - Updated documentation
3
8
  - Fixed an envkey/dotenv related bug preventing the gem from starting
@@ -29,7 +29,7 @@ module BingAdsRubySdk
29
29
 
30
30
  class ServerError < GeneralError
31
31
  def initialize(server_error)
32
- super "Server raised error #{server_error}"
32
+ super("Server raised error #{server_error}")
33
33
  end
34
34
  end
35
35
 
@@ -45,19 +45,14 @@ module BingAdsRubySdk
45
45
  error_list = all_errors
46
46
  return @message if error_list.empty?
47
47
 
48
- first_message = first_error_message(error_list)
49
- if error_list.count > 1
50
- "API raised #{error_list.count} errors, including: #{first_message}"
51
- else
52
- first_message
53
- end
48
+ concatenated_error_messages(error_list)
54
49
  end
55
50
 
56
51
  private
57
52
 
58
53
  def populate_error_lists
59
54
  self.class.error_lists.each do |key|
60
- instance_variable_set("@#{key}", array_wrap(fault_hash[key]))
55
+ instance_variable_set(:"@#{key}", array_wrap(fault_hash[key]))
61
56
  end
62
57
  end
63
58
 
@@ -85,9 +80,18 @@ module BingAdsRubySdk
85
80
  BingAdsRubySdk::StringUtils.snakize(class_name).to_sym
86
81
  end
87
82
 
88
- def first_error_message(error_list)
89
- error = error_list.first.values.first
90
- format_message(error[:error_code], error[:message])
83
+ def concatenated_error_messages(error_list)
84
+ errors = error_list.map do |error|
85
+ if error.is_a?(Hash) && error[:error_code]
86
+ error
87
+ else
88
+ error.values
89
+ end
90
+ end.flatten.compact
91
+
92
+ errors.map do |error|
93
+ format_message(error[:error_code], error[:message])
94
+ end.uniq.join(", ")
91
95
  end
92
96
 
93
97
  def array_wrap(value)
@@ -123,13 +127,13 @@ module BingAdsRubySdk
123
127
  raw_response[fault_key] || {}
124
128
  end
125
129
 
126
- # Gets the first error message in the list. This is
127
- # overridden because partial errors are structured differently
130
+ # This is overridden because partial errors are structured differently
128
131
  # to application faults
129
132
  # @return [Hash] containing the details of the error
130
- def first_error_message(error_list)
131
- error = error_list.first
132
- format_message(error[:error_code], error[:message])
133
+ def concatenated_error_messages(error_list)
134
+ error_list.map do |error|
135
+ format_message(error[:error_code], error[:message])
136
+ end.uniq.join(", ")
133
137
  end
134
138
  end
135
139
 
@@ -37,9 +37,8 @@ module BingAdsRubySdk
37
37
  wrap_array(
38
38
  call(__method__, message)
39
39
  .dig(:ad_extension_association_collection, :ad_extension_association_collection)
40
- .first
41
- .dig(:ad_extension_associations, :ad_extension_association)
42
- )
40
+ .map { |entity_group| entity_group.dig(:ad_extension_associations, :ad_extension_association) }
41
+ ).flatten
43
42
  rescue
44
43
  []
45
44
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BingAdsRubySdk
4
- VERSION = "1.6"
4
+ VERSION = "1.7"
5
5
  DEFAULT_SDK_VERSION = :v13
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bing_ads_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.6'
4
+ version: '1.7'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Effilab
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-14 00:00:00.000000000 Z
12
+ date: 2024-11-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: signet
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  requirements: []
266
- rubygems_version: 3.4.10
266
+ rubygems_version: 3.5.22
267
267
  signing_key:
268
268
  specification_version: 4
269
269
  summary: Bing Ads Ruby SDK