bing_ads_ruby_sdk 1.3.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +21 -19
  3. data/.github/.keep +0 -0
  4. data/.github/renovate.json +225 -0
  5. data/Gemfile +2 -0
  6. data/Rakefile +4 -4
  7. data/bing_ads_ruby_sdk.gemspec +25 -27
  8. data/changelog.md +10 -0
  9. data/lib/bing_ads_ruby_sdk/api.rb +3 -6
  10. data/lib/bing_ads_ruby_sdk/augmented_parser.rb +0 -1
  11. data/lib/bing_ads_ruby_sdk/configuration.rb +1 -1
  12. data/lib/bing_ads_ruby_sdk/errors/error_handler.rb +1 -1
  13. data/lib/bing_ads_ruby_sdk/errors/errors.rb +9 -10
  14. data/lib/bing_ads_ruby_sdk/header.rb +3 -3
  15. data/lib/bing_ads_ruby_sdk/http_client.rb +6 -6
  16. data/lib/bing_ads_ruby_sdk/log_message.rb +2 -3
  17. data/lib/bing_ads_ruby_sdk/oauth2/authorization_handler.rb +24 -21
  18. data/lib/bing_ads_ruby_sdk/oauth2/fs_store.rb +2 -2
  19. data/lib/bing_ads_ruby_sdk/postprocessors/cast_long_arrays.rb +2 -3
  20. data/lib/bing_ads_ruby_sdk/postprocessors/snakize.rb +2 -3
  21. data/lib/bing_ads_ruby_sdk/preprocessors/camelize.rb +3 -4
  22. data/lib/bing_ads_ruby_sdk/preprocessors/order.rb +2 -3
  23. data/lib/bing_ads_ruby_sdk/services/ad_insight.rb +1 -2
  24. data/lib/bing_ads_ruby_sdk/services/base.rb +13 -10
  25. data/lib/bing_ads_ruby_sdk/services/bulk.rb +1 -2
  26. data/lib/bing_ads_ruby_sdk/services/campaign_management.rb +2 -5
  27. data/lib/bing_ads_ruby_sdk/services/customer_billing.rb +1 -2
  28. data/lib/bing_ads_ruby_sdk/services/customer_management.rb +1 -2
  29. data/lib/bing_ads_ruby_sdk/services/reporting.rb +1 -2
  30. data/lib/bing_ads_ruby_sdk/soap_client.rb +11 -17
  31. data/lib/bing_ads_ruby_sdk/string_utils.rb +6 -7
  32. data/lib/bing_ads_ruby_sdk/version.rb +1 -1
  33. data/lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb +0 -1
  34. data/lib/bing_ads_ruby_sdk.rb +10 -9
  35. data/spec/bing_ads_ruby_sdk/api_spec.rb +3 -3
  36. data/spec/bing_ads_ruby_sdk/errors/error_handler_spec.rb +112 -114
  37. data/spec/bing_ads_ruby_sdk/errors/errors_spec.rb +4 -4
  38. data/spec/bing_ads_ruby_sdk/header_spec.rb +22 -22
  39. data/spec/bing_ads_ruby_sdk/http_client_spec.rb +3 -5
  40. data/spec/bing_ads_ruby_sdk/oauth2/fs_store_spec.rb +2 -3
  41. data/spec/bing_ads_ruby_sdk/postprocessors/cast_long_arrays_spec.rb +4 -5
  42. data/spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb +1 -2
  43. data/spec/bing_ads_ruby_sdk/preprocessors/camelize_spec.rb +1 -2
  44. data/spec/bing_ads_ruby_sdk/preprocessors/order_spec.rb +87 -76
  45. data/spec/bing_ads_ruby_sdk/services/bulk_spec.rb +7 -12
  46. data/spec/bing_ads_ruby_sdk/services/campaign_management_spec.rb +74 -67
  47. data/spec/bing_ads_ruby_sdk/services/customer_management_spec.rb +22 -23
  48. data/spec/examples/1_customer_creation/customer_spec.rb +11 -11
  49. data/spec/examples/2_with_customer/budget_spec.rb +19 -21
  50. data/spec/examples/2_with_customer/campaigns_spec.rb +9 -10
  51. data/spec/examples/2_with_customer/customer_management_spec.rb +37 -39
  52. data/spec/examples/2_with_customer/uet_tags_spec.rb +14 -14
  53. data/spec/examples/3_with_uet_tag/conversion_goal_spec.rb +19 -19
  54. data/spec/examples/3_with_uet_tag/uet_tags_spec.rb +15 -15
  55. data/spec/examples/4_with_conversion_goal/conversion_goals_spec.rb +23 -22
  56. data/spec/examples/5_with_campaign/ad_extension_spec.rb +20 -23
  57. data/spec/examples/5_with_campaign/ad_group_spec.rb +14 -15
  58. data/spec/examples/5_with_campaign/campaign_criterions_spec.rb +21 -23
  59. data/spec/examples/5_with_campaign/campaign_spec.rb +17 -18
  60. data/spec/examples/6_with_ad_group/ad_group_spec.rb +19 -20
  61. data/spec/examples/6_with_ad_group/ads_spec.rb +38 -41
  62. data/spec/examples/6_with_ad_group/keywords_spec.rb +29 -32
  63. data/spec/examples/examples.rb +3 -4
  64. data/spec/spec_helper.rb +10 -10
  65. data/spec/support/spec_helpers.rb +10 -9
  66. data/tasks/bing_ads_ruby_sdk.rake +7 -8
  67. metadata +8 -84
  68. data/.github/delete-merged-branch-config.yml +0 -6
  69. data/.github/stale.yml +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99e4be2d8abe1ee49225dcf73b1daa622c07baa7d40d55fe5e745ccb2bdcb071
4
- data.tar.gz: f0712baebfd530c3d98f39a009e4679496fd64926c183c89e87ee93de8493cd0
3
+ metadata.gz: 0a6b39b428d7a606c0072d095766bff29b4d7c9e44dd2f825bdb2654915ad14a
4
+ data.tar.gz: 7d6c717dbec5df6bceeb13ec38a000bbf1252f83ce2030c1071a55fe3a8386ab
5
5
  SHA512:
6
- metadata.gz: ef9561dfc43a108a31a926319cdfe8535e4703b58f367c827f0f0a88d20009a28f19d66fe7ab19e2f9dd9e42018be74ff69ebc1da42f5c9f1dbe1ad500450279
7
- data.tar.gz: e1ba475d1b2352f007e71d94b0fa2d880356f6ab501cd93172ca162ccbd3209bd2a23b99b062cb82957c31180412ce78b12ed6920c179beca1ab108a8bb09973
6
+ metadata.gz: d6232334e3e2c510825d83b9d2476ca601eae477c744e7b9b30ac637d0afc3f965127043c5465d5797ec87dc67b4c80150c52dc54f680676c7be49da1f8d6c98
7
+ data.tar.gz: e3ff1cc382a5099754b37fb42b7858d79c0474dcfd22faef5e05c8498ce9c61a625df852adc638d94463682beb37cbf1d715358d4fa80b6daf022510011640bf
data/.circleci/config.yml CHANGED
@@ -1,27 +1,15 @@
1
- # Ruby CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
- #
5
- version: 2
6
- jobs:
7
- build:
8
- docker:
9
- - image: circleci/ruby:2.4.1
10
-
11
- working_directory: ~/repo
1
+ version: 2.1
12
2
 
3
+ commands:
4
+ build:
13
5
  steps:
14
6
  - checkout
15
-
16
- # We can't use restore_cache because we don't include a Gemfile.lock
17
- # in the Gem repo
18
-
7
+ # We can't use restore_cache because we don't include a Gemfile.lock in the Gem repo
19
8
  - run:
20
9
  name: install dependencies
21
10
  command: |
22
11
  bundle install --jobs=4 --retry=3 --path vendor/bundle
23
-
24
- # run tests!
12
+ - run: bundle exec standardrb
25
13
  - run:
26
14
  name: run tests
27
15
  command: |
@@ -36,7 +24,6 @@ jobs:
36
24
  --out /tmp/test-results/rspec.xml \
37
25
  --format progress \
38
26
  $TEST_FILES
39
-
40
27
  # collect reports
41
28
  - store_test_results:
42
29
  path: /tmp/test-results
@@ -44,9 +31,24 @@ jobs:
44
31
  path: /tmp/test-results
45
32
  destination: test-results
46
33
 
34
+ jobs:
35
+ build_2_x:
36
+ docker:
37
+ - image: ruby:2.7.6
38
+ working_directory: ~/repo
39
+ steps:
40
+ - build
41
+
42
+ build_3_x:
43
+ docker:
44
+ - image: ruby:3.1.2
45
+ working_directory: ~/repo
46
+ steps:
47
+ - build
47
48
 
48
49
  workflows:
49
50
  version: 2
50
51
  build:
51
52
  jobs:
52
- - build
53
+ - build_2_x
54
+ - build_3_x
data/.github/.keep ADDED
File without changes
@@ -0,0 +1,225 @@
1
+ {
2
+ "extends": [
3
+ "config:base",
4
+ "schedule:weekly",
5
+ ":preserveSemverRanges"
6
+ ],
7
+ "kubernetes": {
8
+ "fileMatch": [
9
+ "\\.yaml$",
10
+ "\\.tpl$"
11
+ ]
12
+ },
13
+ "branchPrefix": "bot-",
14
+ "hostRules": [
15
+ {
16
+ "matchHost": "github.com",
17
+ "hostType": "rubygems",
18
+ "encrypted": {
19
+ "token": "wcFMA/xDdHCJBTolARAAjumTJ4PWx0T4aV3fSFZrLqZsnGUW+j+IKh1WPdzAiGdj+9zUQNcdJimlokWffqMzn3pNC8B8GMb+UjStyxQjZH+kzK6fEU4bn9hsg+g8LVHccvRXjzbIwaIyDcBZE0scr9yS7QRk/xI2vviDMAXTiyQEwMIRCfIAaPhcJBbg7L9kRmDmvnlDXPIVkzvenQYFA+3Smib0tL2glJ5NhS/ZgQUAIaz64d/Ibe+PM5atR2+cEf4o0PmBGSa6yGcGJX32kiR0AFMesNtIKWjh5UUjH4M5k0Uuz3bHU2Q85NjXrcmZD1Pqz//LZn+aFYSiDHM7sOHk+LXYnPtjs3+6KrI40tfo64kS4Xp72L/XhE0trhVPki2NmoQXU9ux8YgCCNZb4La3XcGlS0tWAAJU5Ebajx7qCVqweKpoEHHkim+sXl75s3Qu3WOQCgdAWtL3Vds3cu9D4ZEe0Hax6XxurZ/BuE5MS5i3Kd85JFlRgPD+C+/2EABKrCzTpDHNIK72tAY50rgFM1uvGIgaQVHEVsU0l1dm0DzxTwisWERpr90CNaz5dhGT5lYer+p8z5Gye00kn+SWyqWWTTZ0c+ZLh+eEQ6/TdWhFHjBi8524lvotbAT3Wq7lLDWeS3vAW/bj39v7LPbUGIXdvxIvF9EUwr1NRTviOASLXrEH7NNk99RheiLSdgFWqKKuKEGE2gq0t3vXA85GoT7wU0wB4RKCKqGrCK8AbL+PwvKxKZ+P63F+EfMyhIq89Qw9Szu6KbeNoYwsEQgYyXko/HDMWWqfQcTKEMF6rGf7KRmCFEIjrsSO4LJ+RcbmZBESr+L1T790c2nuFjwGI1qcA0Y"
20
+ }
21
+ }
22
+ ],
23
+ "vulnerabilityAlerts": {
24
+ "enabled": true,
25
+ "automerge": true,
26
+ "groupName": null,
27
+ "labels": [
28
+ "security"
29
+ ],
30
+ "schedule": [
31
+ "after 2am and before 6am every day"
32
+ ]
33
+ },
34
+ "packageRules": [
35
+ {
36
+ "matchPackagePatterns": ["*"],
37
+ "stabilityDays": 5
38
+ },
39
+ {
40
+ "matchDatasources": ["terraform-module","terraform-provider"],
41
+ "labels": ["terraform"],
42
+ "groupName": "terraform",
43
+ "automerge": false
44
+ },
45
+ {
46
+ "matchDepTypes": ["devDependencies"],
47
+ "matchPackagePatterns": ["lint", "prettier"],
48
+ "groupName": "linter-update",
49
+ "labels": ["linter-update"],
50
+ "automerge": true
51
+ },
52
+ {
53
+ "matchManagers": ["nodenv", "npm"],
54
+ "groupName": "js-update",
55
+ "labels": ["js-update"],
56
+ "automerge": true
57
+ },
58
+ {
59
+ "matchManagers": ["bundler", "ruby-version"],
60
+ "groupName": "ruby-update",
61
+ "automerge": true,
62
+ "labels": ["ruby-update"]
63
+ },
64
+ {
65
+ "matchManagers": ["pip-compile", "pip_requirements", "pip_setup", "pipenv", "pyenv", "setup-cfg"],
66
+ "groupName": "python-update",
67
+ "automerge": true,
68
+ "labels": ["python-update"]
69
+ },
70
+ {
71
+ "matchDepTypes": ["peerDependencies", "devDependencies", "dependencies"],
72
+ "matchUpdateTypes": ["minor","patch","pin","digest","rollback","bump"],
73
+ "groupName": "dep-update",
74
+ "labels": ["dependencies-update"],
75
+ "automerge": true
76
+ },
77
+ {
78
+ "matchCurrentVersion": "/^v?[~ -]?0/",
79
+ "matchUpdateTypes": [
80
+ "minor",
81
+ "patch",
82
+ "pin",
83
+ "digest",
84
+ "rollback",
85
+ "bump"
86
+ ],
87
+ "groupName": "betas can break",
88
+ "labels": ["betas-update"],
89
+ "description": "according semver spec, version <1 can introduce breaking changes on each rel",
90
+ "automerge": false
91
+ },
92
+ {
93
+ "matchManagers": ["gitlabci", "gitlabci-include", "circleci", "helm-requirements", "helm-values", "helmfile", "helmv3","docker-compose", "dockerfile","kubernetes"],
94
+ "automerge": true,
95
+ "groupName": "ci-update",
96
+ "labels": ["ci-update"]
97
+ },
98
+ {
99
+ "matchManagers": [
100
+ "gitlabci",
101
+ "gitlabci-include",
102
+ "circleci",
103
+ "helm-requirements",
104
+ "helm-values",
105
+ "helmfile",
106
+ "helmv3",
107
+ "docker-compose",
108
+ "dockerfile",
109
+ "kubernetes"
110
+ ],
111
+ "matchPackageNames": ["redis"],
112
+ "allowedVersions": "<6",
113
+ "automerge": true,
114
+ "groupName": "redis-update",
115
+ "description": "explicit max version to keep coherence with real infra on GCP"
116
+ },
117
+ {
118
+ "matchPackageNames": ["jdk","openjdk"],
119
+ "allowedVersions": "<18",
120
+ "automerge": true,
121
+ "groupName": "jdk-update",
122
+ "description": "explicit max version to keep LTS only"
123
+ },
124
+ {
125
+ "matchPackageNames": ["cimg/postgres","postgres","postgis","postgis/postgis"],
126
+ "allowedVersions": "<14",
127
+ "automerge": true,
128
+ "groupName": "postgres-update",
129
+ "labels": ["postgres"],
130
+ "description": "explicit max version to prevent issue like need to coordinate with real infra on GCP"
131
+ },
132
+ {
133
+ "matchPackageNames": ["ruby","circleci/ruby","cimg/ruby"],
134
+ "allowedVersions": "<4",
135
+ "groupName": "rubycore-update",
136
+ "description": "explicit max version to prevent issues",
137
+ "labels": ["rubycore-update"]
138
+ },
139
+ {
140
+ "matchPackageNames": ["node","circleci/node","cimg/node"],
141
+ "automerge": true,
142
+ "allowedVersions": "<17",
143
+ "groupName": "node-update",
144
+ "labels": ["node-update"],
145
+ "description": "explicit max LTS version to prevent issues : https://cloud.google.com/functions/docs/concepts/nodejs-runtime "
146
+ },
147
+ {
148
+ "matchPackageNames": ["python"],
149
+ "automerge": true,
150
+ "groupName": "python-update",
151
+ "labels": ["python-update"]
152
+ },
153
+ {
154
+ "matchPackageNames": ["circleci/python","cimg/python"],
155
+ "automerge": true,
156
+ "allowedVersions": "<4",
157
+ "groupName": "pythoncore-update",
158
+ "labels": ["pythoncore-update"],
159
+ "description": "explicit max major version to prevent issues"
160
+ },
161
+ {
162
+ "matchPackageNames": ["xgboost"],
163
+ "automerge": true,
164
+ "allowedVersions": "<1.5",
165
+ "groupName": "xgboost-update",
166
+ "description": "limitation from the data model used in pricer"
167
+ },
168
+ {
169
+ "matchPackageNames": ["pandas"],
170
+ "allowedVersions": "<1.4",
171
+ "automerge": true,
172
+ "groupName": "pandas-update",
173
+ "description": "limitation from dataiku, don't merge upper than 1.3 for now"
174
+ },
175
+ {
176
+ "matchPackageNames": [
177
+ "gql"
178
+ ],
179
+ "automerge": true,
180
+ "allowedVersions": "<3",
181
+ "groupName": "gql-update",
182
+ "description": "limitation from dataiku"
183
+ },
184
+ {
185
+ "matchPackageNames": [
186
+ "envkey"
187
+ ],
188
+ "automerge": true,
189
+ "allowedVersions": "<2",
190
+ "groupName": "envkey-update",
191
+ "description": "no switch for now"
192
+ },
193
+ {
194
+ "matchPackageNames": [
195
+ "facebookbusiness"
196
+ ],
197
+ "groupName": "envkey-update",
198
+ "description": "Facebook API",
199
+ "labels": [
200
+ "apifacebook-update"
201
+ ]
202
+ },
203
+ {
204
+ "matchPackageNames": [
205
+ "google-ads-googleads"
206
+ ],
207
+ "groupName": "googleads-update",
208
+ "description": "Google Ads API",
209
+ "labels": [
210
+ "apigoogleads-update"
211
+ ]
212
+ }
213
+ ],
214
+ "lockFileMaintenance": {
215
+ "enabled": true,
216
+ "schedule": ["after 2am and before 6am every monday"],
217
+ "commitMessageAction": "Update lockfiles",
218
+ "groupName": "lockfile-update",
219
+ "labels": ["lockfile-update"],
220
+ "automerge": true
221
+ },
222
+ "dependencyDashboard": true,
223
+ "timezone": "Europe/Paris",
224
+ "prHourlyLimit": 6
225
+ }
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in bing_ads_ruby_sdk.gemspec
4
4
  gemspec
5
+
6
+ gem "standard", "1.16.1"
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require './lib/bing_ads_ruby_sdk'
4
- import 'tasks/bing_ads_ruby_sdk.rake'
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "./lib/bing_ads_ruby_sdk"
4
+ import "tasks/bing_ads_ruby_sdk.rake"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
@@ -1,37 +1,35 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("../lib", __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'bing_ads_ruby_sdk/version'
3
+ require "bing_ads_ruby_sdk/version"
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = 'bing_ads_ruby_sdk'
8
- spec.required_ruby_version = '>= 2.0'
6
+ spec.name = "bing_ads_ruby_sdk"
7
+ spec.required_ruby_version = ">= 2.3"
9
8
 
10
- spec.version = BingAdsRubySdk::VERSION
11
- spec.authors = %w[Effilab developers]
12
- spec.email = %w[developers@effilab-local.com]
9
+ spec.version = BingAdsRubySdk::VERSION
10
+ spec.authors = %w[Effilab developers]
11
+ spec.email = %w[dev@effilab.com]
13
12
 
14
- spec.summary = 'Bing Ads Ruby SDK'
15
- spec.description = 'Bing Ads Api Wrapper'
16
- spec.homepage = 'https://github.com/Effilab/bing_ads_ruby_sdk'
17
- spec.license = 'MIT'
13
+ spec.summary = "Bing Ads Ruby SDK"
14
+ spec.description = "Bing Ads Api Wrapper"
15
+ spec.homepage = "https://github.com/Effilab/bing_ads_ruby_sdk"
16
+ spec.license = "MIT"
18
17
 
19
- spec.files = `git ls-files`.split($/)
20
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
- spec.test_files = spec.files.grep(%r{^(spec)/})
18
+ spec.files = `git ls-files`.split($/)
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
20
  spec.require_paths = ["lib"]
23
21
 
24
- spec.add_runtime_dependency 'signet'
25
- spec.add_runtime_dependency 'excon', '>= 0.62.0'
26
- spec.add_runtime_dependency 'lolsoap', '>=0.9.0'
22
+ spec.add_runtime_dependency "signet"
23
+ spec.add_runtime_dependency "excon", ">= 0.62.0"
24
+ spec.add_runtime_dependency "lolsoap", ">=0.9.0"
27
25
 
28
- spec.add_development_dependency 'bundler'
29
- spec.add_development_dependency 'dotenv'
30
- spec.add_development_dependency 'rake'
31
- spec.add_development_dependency 'yard'
32
- spec.add_development_dependency 'rspec'
33
- spec.add_development_dependency 'simplecov'
34
- spec.add_development_dependency 'byebug'
35
- spec.add_development_dependency 'awesome_print'
36
- spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
26
+ spec.add_development_dependency "bundler"
27
+ spec.add_development_dependency "dotenv"
28
+ spec.add_development_dependency "rake"
29
+ spec.add_development_dependency "yard"
30
+ spec.add_development_dependency "rspec"
31
+ spec.add_development_dependency "simplecov"
32
+ spec.add_development_dependency "byebug"
33
+ spec.add_development_dependency "awesome_print"
34
+ spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
37
35
  end
data/changelog.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## V1.5.0 Release
2
+ - Breaking: Now raises functional errors
3
+ - Breaking: Now raises an error if not able to read the store in order to refresh the token
4
+
5
+ ## V1.4.0 Release
6
+
7
+ - Breaking: change scope from `https://ads.microsoft.com/ads.manage` to `https://ads.microsoft.com/msads.manage` as requested by Bing (deadline March 22)
8
+
9
+ - now reading store at the very last moment to get freshest token
10
+
1
11
  ## V1.3.4 Release
2
12
 
3
13
  - lift constraint on signet gem
@@ -23,12 +23,9 @@ module BingAdsRubySdk
23
23
  # @option environment [Symbol] :sandbox Use the sandbox WSDL configuration
24
24
  # @param developer_token
25
25
  # @param client_id
26
- def initialize(version: DEFAULT_SDK_VERSION,
27
- environment: :production,
28
- developer_token:,
29
- client_id:,
30
- oauth_store:,
31
- client_secret: nil)
26
+ def initialize(developer_token:, client_id:, oauth_store:, version: DEFAULT_SDK_VERSION,
27
+ environment: :production,
28
+ client_secret: nil)
32
29
  @version = version
33
30
  @environment = environment
34
31
  @header = Header.new(
@@ -2,7 +2,6 @@
2
2
 
3
3
  module BingAdsRubySdk
4
4
  class AugmentedParser
5
-
6
5
  def initialize(wsdl_file_path)
7
6
  @lolsoap_parser = LolSoap::WSDLParser.parse(File.read(wsdl_file_path))
8
7
  @concrete_abstract_mapping = {}
@@ -24,4 +24,4 @@ module BingAdsRubySdk
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -36,7 +36,7 @@ module BingAdsRubySdk
36
36
  end
37
37
 
38
38
  def partial_errors
39
- response.select {|key| partial_error_keys.include?(key)}
39
+ response.select { |key| partial_error_keys.include?(key) }
40
40
  end
41
41
 
42
42
  # Gets populated partial error keys from the response
@@ -9,11 +9,11 @@ module BingAdsRubySdk
9
9
  def initialize(response)
10
10
  @raw_response = response
11
11
 
12
- code = response[:error_code] || 'Bing Ads API error'
12
+ code = response[:error_code] || "Bing Ads API error"
13
13
 
14
14
  message = response[:message] ||
15
- response[:faultstring] ||
16
- 'See exception details for more information.'
15
+ response[:faultstring] ||
16
+ "See exception details for more information."
17
17
 
18
18
  @message = format_message(code, message)
19
19
  end
@@ -23,7 +23,7 @@ module BingAdsRubySdk
23
23
  # Format the message separated by hyphen if
24
24
  # there is a code and a message
25
25
  def format_message(code, message)
26
- [code, message].compact.join(' - ')
26
+ [code, message].compact.join(" - ")
27
27
  end
28
28
  end
29
29
 
@@ -47,7 +47,7 @@ module BingAdsRubySdk
47
47
 
48
48
  first_message = first_error_message(error_list)
49
49
  if error_list.count > 1
50
- "API raised #{ error_list.count } errors, including: #{first_message}"
50
+ "API raised #{error_list.count} errors, including: #{first_message}"
51
51
  else
52
52
  first_message
53
53
  end
@@ -81,7 +81,7 @@ module BingAdsRubySdk
81
81
  # The fault key that corresponds to the inherited class
82
82
  # @return [Symbol] the fault key
83
83
  def fault_key
84
- class_name = self.class.name.split('::').last
84
+ class_name = self.class.name.split("::").last
85
85
  BingAdsRubySdk::StringUtils.snakize(class_name).to_sym
86
86
  end
87
87
 
@@ -100,9 +100,7 @@ module BingAdsRubySdk
100
100
  end
101
101
 
102
102
  class << self
103
- def error_lists=(value)
104
- @error_lists = value
105
- end
103
+ attr_writer :error_lists
106
104
 
107
105
  def error_lists
108
106
  @error_lists ||= []
@@ -118,7 +116,6 @@ module BingAdsRubySdk
118
116
 
119
117
  # Base class for handling partial errors
120
118
  class PartialErrorBase < ApplicationFault
121
-
122
119
  private
123
120
 
124
121
  # The parent hash for this type of error is the root of the response
@@ -140,6 +137,7 @@ module BingAdsRubySdk
140
137
  define_error_lists :batch_error
141
138
 
142
139
  private
140
+
143
141
  def fault_key
144
142
  :partial_errors
145
143
  end
@@ -149,6 +147,7 @@ module BingAdsRubySdk
149
147
  define_error_lists :batch_error_collection
150
148
 
151
149
  private
150
+
152
151
  def fault_key
153
152
  :nested_partial_errors
154
153
  end
@@ -18,9 +18,9 @@ module BingAdsRubySdk
18
18
  def content
19
19
  {
20
20
  "AuthenticationToken" => auth_handler.fetch_or_refresh,
21
- "DeveloperToken" => developer_token,
22
- "CustomerId" => customer[:customer_id],
23
- "CustomerAccountId" => customer[:account_id]
21
+ "DeveloperToken" => developer_token,
22
+ "CustomerId" => customer[:customer_id],
23
+ "CustomerAccountId" => customer[:account_id]
24
24
  }.tap do |hash|
25
25
  hash["ClientSecret"] = client_secret if client_secret
26
26
  end
@@ -10,7 +10,7 @@ module BingAdsRubySdk
10
10
  HTTP_READ_TIMEOUT = 20
11
11
  HTTP_RETRY_COUNT_ON_TIMEOUT = 2
12
12
  HTTP_INTERVAL_RETRY_COUNT_ON_TIMEOUT = 1
13
- HTTP_ERRORS = [ Net::HTTPServerError, Net::HTTPClientError ]
13
+ HTTP_ERRORS = [Net::HTTPServerError, Net::HTTPClientError]
14
14
  CONNECTION_SETTINGS = {
15
15
  persistent: true,
16
16
  tcp_nodelay: true,
@@ -20,17 +20,17 @@ module BingAdsRubySdk
20
20
  connect_timeout: HTTP_OPEN_TIMEOUT,
21
21
  read_timeout: HTTP_READ_TIMEOUT,
22
22
  ssl_version: :TLSv1_2,
23
- ciphers: "TLSv1.2:!aNULL:!eNULL",
23
+ ciphers: "TLSv1.2:!aNULL:!eNULL"
24
24
  }
25
25
 
26
26
  class << self
27
27
  def post(request)
28
28
  uri = URI(request.url)
29
- conn = self.connection(request.url)
29
+ conn = connection(request.url)
30
30
  raw_response = conn.post(
31
31
  path: uri.path,
32
32
  body: request.content,
33
- headers: request.headers,
33
+ headers: request.headers
34
34
  )
35
35
 
36
36
  if contains_error?(raw_response)
@@ -44,7 +44,7 @@ module BingAdsRubySdk
44
44
  end
45
45
 
46
46
  def close_http_connections
47
- self.http_connections.values.each do |connection|
47
+ http_connections.values.each do |connection|
48
48
  connection.reset
49
49
  end
50
50
  end
@@ -65,7 +65,7 @@ module BingAdsRubySdk
65
65
  end
66
66
 
67
67
  def connection(host)
68
- self.http_connections[host] ||= Excon.new(
68
+ http_connections[host] ||= Excon.new(
69
69
  host,
70
70
  connection_settings
71
71
  )
@@ -2,7 +2,6 @@
2
2
 
3
3
  module BingAdsRubySdk
4
4
  class LogMessage
5
-
6
5
  def initialize(message)
7
6
  @message = message
8
7
  end
@@ -43,7 +42,7 @@ module BingAdsRubySdk
43
42
  end
44
43
 
45
44
  def nokogiri_options
46
- pretty_print ? { indent: 2 } : { save_with: Nokogiri::XML::Node::SaveOptions::AS_XML }
45
+ pretty_print ? {indent: 2} : {save_with: Nokogiri::XML::Node::SaveOptions::AS_XML}
47
46
  end
48
47
 
49
48
  def pretty_print
@@ -54,4 +53,4 @@ module BingAdsRubySdk
54
53
  BingAdsRubySdk.config.filters
55
54
  end
56
55
  end
57
- end
56
+ end