bing_ads_ruby_sdk 1.5.0 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +21 -5
  4. data/Rakefile +1 -1
  5. data/bing_ads_ruby_sdk.gemspec +9 -1
  6. data/changelog.md +3 -0
  7. data/lib/Rakefile +4 -0
  8. data/lib/bing_ads_ruby_sdk/errors/errors.rb +1 -1
  9. data/lib/bing_ads_ruby_sdk/railtie.rb +13 -0
  10. data/{tasks → lib/bing_ads_ruby_sdk/tasks}/bing_ads_ruby_sdk.rake +1 -1
  11. data/lib/bing_ads_ruby_sdk/version.rb +1 -1
  12. data/lib/bing_ads_ruby_sdk.rb +1 -0
  13. metadata +6 -85
  14. data/.circleci/config.yml +0 -54
  15. data/.github/.keep +0 -0
  16. data/.github/renovate.json +0 -225
  17. data/.gitignore +0 -19
  18. data/.rspec +0 -4
  19. data/spec/bing_ads_ruby_sdk/api_spec.rb +0 -17
  20. data/spec/bing_ads_ruby_sdk/errors/error_handler_spec.rb +0 -477
  21. data/spec/bing_ads_ruby_sdk/errors/errors_spec.rb +0 -13
  22. data/spec/bing_ads_ruby_sdk/header_spec.rb +0 -60
  23. data/spec/bing_ads_ruby_sdk/http_client_spec.rb +0 -42
  24. data/spec/bing_ads_ruby_sdk/oauth2/fs_store_spec.rb +0 -19
  25. data/spec/bing_ads_ruby_sdk/postprocessors/cast_long_arrays_spec.rb +0 -29
  26. data/spec/bing_ads_ruby_sdk/postprocessors/snakize_spec.rb +0 -39
  27. data/spec/bing_ads_ruby_sdk/preprocessors/camelize_spec.rb +0 -39
  28. data/spec/bing_ads_ruby_sdk/preprocessors/order_spec.rb +0 -130
  29. data/spec/bing_ads_ruby_sdk/services/bulk_spec.rb +0 -51
  30. data/spec/bing_ads_ruby_sdk/services/campaign_management_spec.rb +0 -314
  31. data/spec/bing_ads_ruby_sdk/services/customer_management_spec.rb +0 -96
  32. data/spec/bing_ads_ruby_sdk_spec.rb +0 -5
  33. data/spec/examples/1_customer_creation/customer_spec.rb +0 -35
  34. data/spec/examples/2_with_customer/budget_spec.rb +0 -52
  35. data/spec/examples/2_with_customer/campaigns_spec.rb +0 -26
  36. data/spec/examples/2_with_customer/customer_management_spec.rb +0 -188
  37. data/spec/examples/2_with_customer/uet_tags_spec.rb +0 -42
  38. data/spec/examples/3_with_uet_tag/conversion_goal_spec.rb +0 -40
  39. data/spec/examples/3_with_uet_tag/uet_tags_spec.rb +0 -56
  40. data/spec/examples/4_with_conversion_goal/conversion_goals_spec.rb +0 -76
  41. data/spec/examples/5_with_campaign/ad_extension_spec.rb +0 -235
  42. data/spec/examples/5_with_campaign/ad_group_spec.rb +0 -34
  43. data/spec/examples/5_with_campaign/campaign_criterions_spec.rb +0 -72
  44. data/spec/examples/5_with_campaign/campaign_spec.rb +0 -70
  45. data/spec/examples/6_with_ad_group/ad_group_spec.rb +0 -70
  46. data/spec/examples/6_with_ad_group/ads_spec.rb +0 -110
  47. data/spec/examples/6_with_ad_group/keywords_spec.rb +0 -105
  48. data/spec/examples/examples.rb +0 -75
  49. data/spec/fixtures/bulk/download_campaigns_by_account_ids/standard.xml +0 -23
  50. data/spec/fixtures/bulk/download_campaigns_by_account_ids/standard_response.xml +0 -11
  51. data/spec/fixtures/bulk/get_bulk_download_status/standard.xml +0 -14
  52. data/spec/fixtures/bulk/get_bulk_download_status/standard_response.xml +0 -15
  53. data/spec/fixtures/campaign_management/add_ad_extensions/standard.xml +0 -21
  54. data/spec/fixtures/campaign_management/add_ad_extensions/standard_response.xml +0 -17
  55. data/spec/fixtures/campaign_management/add_conversion_goals/standard.xml +0 -27
  56. data/spec/fixtures/campaign_management/add_conversion_goals/standard_response.xml +0 -14
  57. data/spec/fixtures/campaign_management/add_shared_entity/standard.xml +0 -16
  58. data/spec/fixtures/campaign_management/add_shared_entity/standard_response.xml +0 -13
  59. data/spec/fixtures/campaign_management/add_uet_tags/standard.xml +0 -19
  60. data/spec/fixtures/campaign_management/add_uet_tags/standard_response.xml +0 -21
  61. data/spec/fixtures/campaign_management/get_ad_extension_ids_by_account_id/standard.xml +0 -15
  62. data/spec/fixtures/campaign_management/get_ad_extension_ids_by_account_id/standard_response.xml +0 -13
  63. data/spec/fixtures/campaign_management/get_ad_extensions_associations/standard.xml +0 -19
  64. data/spec/fixtures/campaign_management/get_ad_extensions_associations/standard_response.xml +0 -47
  65. data/spec/fixtures/campaign_management/get_budgets_by_ids/standard.xml +0 -12
  66. data/spec/fixtures/campaign_management/get_budgets_by_ids/standard_response.xml +0 -20
  67. data/spec/fixtures/campaign_management/get_campaigns_by_account_id/standard.xml +0 -14
  68. data/spec/fixtures/campaign_management/get_campaigns_by_account_id/standard_response.xml +0 -84
  69. data/spec/fixtures/campaign_management/get_conversion_goals_by_ids/standard.xml +0 -18
  70. data/spec/fixtures/campaign_management/get_conversion_goals_by_ids/standard_response.xml +0 -61
  71. data/spec/fixtures/campaign_management/get_shared_entities_by_account_id/standard.xml +0 -14
  72. data/spec/fixtures/campaign_management/get_shared_entities_by_account_id/standard_response.xml +0 -20
  73. data/spec/fixtures/campaign_management/get_shared_entity_associations_by_entity_ids/standard.xml +0 -18
  74. data/spec/fixtures/campaign_management/get_shared_entity_associations_by_entity_ids/standard_response.xml +0 -19
  75. data/spec/fixtures/campaign_management/get_uet_tags_by_ids/standard.xml +0 -16
  76. data/spec/fixtures/campaign_management/get_uet_tags_by_ids/standard_response.xml +0 -21
  77. data/spec/fixtures/campaign_management/set_ad_extensions_associations/standard.xml +0 -21
  78. data/spec/fixtures/campaign_management/set_ad_extensions_associations/standard_response.xml +0 -11
  79. data/spec/fixtures/campaign_management/set_shared_entity_associations/standard.xml +0 -21
  80. data/spec/fixtures/campaign_management/set_shared_entity_associations/standard_response.xml +0 -11
  81. data/spec/fixtures/campaign_management/update_conversion_goals/standard.xml +0 -27
  82. data/spec/fixtures/campaign_management/update_conversion_goals/standard_response.xml +0 -11
  83. data/spec/fixtures/campaign_management/update_uet_tags/standard.xml +0 -20
  84. data/spec/fixtures/campaign_management/update_uet_tags/standard_response.xml +0 -11
  85. data/spec/fixtures/customer_management/find_accounts_or_customers_info/standard.xml +0 -15
  86. data/spec/fixtures/customer_management/find_accounts_or_customers_info/standard_response.xml +0 -21
  87. data/spec/fixtures/customer_management/get_account/standard.xml +0 -14
  88. data/spec/fixtures/customer_management/get_account/standard_response.xml +0 -43
  89. data/spec/fixtures/customer_management/signup_customer/standard.xml +0 -30
  90. data/spec/fixtures/customer_management/signup_customer/standard_response.xml +0 -15
  91. data/spec/fixtures/customer_management/update_account/standard.xml +0 -19
  92. data/spec/fixtures/customer_management/update_account/standard_response.xml +0 -11
  93. data/spec/spec_helper.rb +0 -33
  94. data/spec/support/spec_helpers.rb +0 -46
@@ -1,52 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "Budget methods" do
4
- include_context "use api"
5
-
6
- let(:budget_id) { add_budget[:budget_ids].first }
7
-
8
- let(:add_budget) do
9
- api.campaign_management.call(:add_budgets,
10
- budgets: [
11
- budget: {
12
- amount: "10",
13
- budget_type: "DailyBudgetStandard",
14
- name: "test_budget #{random}"
15
- }
16
- ])
17
- end
18
-
19
- describe "#add_budget" do
20
- it "returns budget ids for created Budgets" do
21
- expect(add_budget).to include(
22
- budget_ids: [a_kind_of(Integer)],
23
- partial_errors: ""
24
- )
25
- end
26
- end
27
-
28
- describe "#get_budgets_by_ids" do
29
- before { add_budget }
30
-
31
- it "returns a list of budgets" do
32
- expect(api.campaign_management.get_budgets_by_ids(
33
- budget_ids: [long: budget_id]
34
- )).to include({
35
- amount: "10.00",
36
- association_count: "0",
37
- budget_type: "DailyBudgetStandard",
38
- id: a_kind_of(String),
39
- name: a_string_starting_with("test_budget")
40
- })
41
- end
42
- end
43
-
44
- describe "#delete_budgets" do
45
- before { add_budget }
46
-
47
- it "returns no errors" do
48
- expect(api.campaign_management.call(:delete_budgets,
49
- budget_ids: [{long: budget_id}])).to eq(partial_errors: "")
50
- end
51
- end
52
- end
@@ -1,26 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "CampaignManagement service" do
4
- include_context "use api"
5
-
6
- describe "Campaign methods" do
7
- it "returns campaign ids" do
8
- campaigns = api.campaign_management.call(:add_campaigns,
9
- account_id: Examples.account_id,
10
- campaigns: {
11
- campaign:
12
- {
13
- name: "Acceptance Test Campaign #{random}",
14
- daily_budget: 10,
15
- budget_type: "DailyBudgetStandard",
16
- time_zone: "BrusselsCopenhagenMadridParis"
17
- }
18
- })
19
- expect(campaigns).to include(
20
- partial_errors: "",
21
- campaign_ids: [a_kind_of(Integer)]
22
- )
23
- puts "You can now fill in examples.rb with campaign_id: #{campaigns[:campaign_ids].first}"
24
- end
25
- end
26
- end
@@ -1,188 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "CustomerManagement service" do
4
- include_context "use api"
5
-
6
- let(:get_customer) do
7
- api.customer_management.call(:get_customer, customer_id: Examples.customer_id)
8
- end
9
-
10
- let(:get_account) do
11
- api.customer_management.get_account(account_id: Examples.account_id)
12
- end
13
-
14
- describe "Account methods" do
15
- describe "#find_accounts" do
16
- subject do
17
- api.customer_management.call(:find_accounts,
18
- account_filter: "",
19
- customer_id: Examples.customer_id,
20
- top_n: 1)
21
- end
22
-
23
- it "returns a list of basic account information" do
24
- is_expected.to include(
25
- accounts_info: {
26
- account_info: [
27
- {
28
- id: a_kind_of(String),
29
- name: a_kind_of(String),
30
- number: a_kind_of(String),
31
- account_life_cycle_status: a_kind_of(String),
32
- pause_reason: nil
33
- }
34
- ]
35
- }
36
- )
37
- end
38
- end
39
-
40
- describe "#find_accounts_or_customers_info" do
41
- subject do
42
- api.customer_management.find_accounts_or_customers_info(
43
- filter: "",
44
- top_n: 1
45
- )
46
- end
47
-
48
- it "returns a list of records containing account / customer pairs" do
49
- is_expected.to contain_exactly(
50
- {
51
- customer_id: a_kind_of(String),
52
- customer_name: a_kind_of(String),
53
- account_id: a_kind_of(String),
54
- account_name: a_kind_of(String),
55
- account_number: a_kind_of(String),
56
- account_life_cycle_status: a_kind_of(String), # e.g. 'Active'
57
- pause_reason: nil
58
- }
59
- )
60
- end
61
- end
62
-
63
- describe "#get_account" do
64
- it "returns information about the current account" do
65
- expect(get_account).to include(
66
- account: {
67
- bill_to_customer_id: a_kind_of(String),
68
- currency_code: "USD",
69
- account_financial_status: "ClearFinancialStatus",
70
- id: a_kind_of(String),
71
- language: "English",
72
- last_modified_by_user_id: a_kind_of(String),
73
- last_modified_time: a_kind_of(String),
74
- name: a_string_starting_with("Test Account"),
75
- number: a_kind_of(String),
76
- parent_customer_id: a_kind_of(String),
77
- payment_method_id: a_kind_of(String),
78
- payment_method_type: nil,
79
- primary_user_id: a_kind_of(String),
80
- account_life_cycle_status: "Active",
81
- time_stamp: a_kind_of(String),
82
- time_zone: a_kind_of(String),
83
- pause_reason: nil,
84
- forward_compatibility_map: nil,
85
- linked_agencies: {
86
- customer_info: [
87
- {
88
- id: a_kind_of(String),
89
- name: a_kind_of(String)
90
- }
91
- ]
92
- },
93
- sales_house_customer_id: nil,
94
- tax_information: "",
95
- back_up_payment_instrument_id: nil,
96
- billing_threshold_amount: nil,
97
- business_address: nil,
98
- auto_tag_type: "Inactive",
99
- sold_to_payment_instrument_id: nil
100
- }
101
- )
102
- end
103
- end
104
-
105
- describe "#update_account" do
106
- let(:account) { get_account[:account] }
107
- subject do
108
- api.customer_management.update_account(
109
- account: {
110
- "@type" => "AdvertiserAccount",
111
- :id => account[:id],
112
- :time_stamp => account[:time_stamp],
113
- :name => "Test Account #{Time.now} - updated"
114
- }
115
- )
116
- end
117
-
118
- it "returns the last modified time" do
119
- is_expected.to include(last_modified_time: a_kind_of(String))
120
- end
121
- end
122
- end
123
-
124
- describe "Customer methods" do
125
- describe "get_customer" do
126
- it "returns customer data" do
127
- expect(get_customer).to include(
128
- customer: {
129
- customer_financial_status: "ClearFinancialStatus",
130
- id: a_kind_of(String),
131
- industry: "Entertainment",
132
- last_modified_by_user_id: a_kind_of(String),
133
- last_modified_time: a_kind_of(String),
134
- market_country: "US",
135
- forward_compatibility_map: a_kind_of(Hash),
136
- market_language: "English",
137
- name: a_string_starting_with("Test Customer"),
138
- service_level: "SelfServe",
139
- customer_life_cycle_status: "Active",
140
- time_stamp: a_kind_of(String),
141
- number: a_kind_of(String),
142
- customer_address: a_kind_of(Hash)
143
- }
144
- )
145
- end
146
- end
147
-
148
- describe "#get_customers_info" do
149
- subject do
150
- api.customer_management.call(:get_customers_info,
151
- customer_name_filter: "",
152
- top_n: 1)
153
- end
154
-
155
- it "returns a list of simple customer information" do
156
- is_expected.to include(
157
- customers_info: {
158
- customer_info: a_collection_including(
159
- {
160
- id: a_kind_of(String),
161
- name: a_kind_of(String)
162
- }
163
- )
164
- }
165
- )
166
- end
167
- end
168
-
169
- describe "#update_customer" do
170
- let(:original_customer) { get_customer }
171
-
172
- subject do
173
- api.customer_management.call(:update_customer, {
174
- customer: {
175
- name: "Test Customer - #{Time.now}",
176
- id: Examples.customer_id,
177
- time_stamp: original_customer[:customer][:time_stamp],
178
- industry: original_customer[:customer][:industry]
179
- }
180
- })
181
- end
182
-
183
- it "returns the update timestamp" do
184
- is_expected.to include(last_modified_time: a_kind_of(String))
185
- end
186
- end
187
- end
188
- end
@@ -1,42 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "CampaignManagement service" do
4
- include_context "use api"
5
-
6
- describe "UET methods" do
7
- subject(:add_uet_tags) do
8
- api.campaign_management.add_uet_tags(
9
- uet_tags: [
10
- uet_tag: {
11
- description: "UET Tag Description",
12
- name: "Acceptance Test UET Tag #{random}"
13
- }
14
- ]
15
- )
16
- end
17
-
18
- describe "#add_uet_tags" do
19
- it "returns a list of newly created UET tags" do
20
- uet_tags = add_uet_tags
21
- expect(uet_tags).to include(
22
- uet_tags: {
23
- uet_tag: [
24
- {
25
- description: "UET Tag Description",
26
- id: a_kind_of(String),
27
- name: a_string_starting_with("Acceptance Test UET Tag"),
28
- tracking_no_script: a_string_starting_with("<img src=\"//bat.bing.com/action/"),
29
- tracking_script: a_string_starting_with("<script>(function(w,d,t,r,u)"),
30
- tracking_status: "Unverified",
31
- customer_share: nil
32
- }
33
- ]
34
- },
35
- partial_errors: ""
36
- )
37
-
38
- puts "Please fill in examples.rb with uet_tag_id: #{uet_tags[:uet_tags][:uet_tag].first[:id]}"
39
- end
40
- end
41
- end
42
- end
@@ -1,40 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "Conversion goals methods" do
4
- include_context "use api"
5
-
6
- it "returns a list of Conversion goal Ids" do
7
- conversion_goals = api.campaign_management.add_conversion_goals(
8
- conversion_goals: {
9
- event_goal: {
10
- conversion_window_in_minutes: 43_200, # 30days
11
- count_type: "All",
12
- name: "Acceptance Test Conversion goal #{random}",
13
- revenue: {
14
- currency_code: "EUR",
15
- type: "FixedValue",
16
- value: 5.20
17
- },
18
- scope: "Account",
19
- status: "Active",
20
- tag_id: Examples.uet_tag_id,
21
- action_operator: "Equals",
22
- action_expression: "display_phone",
23
- category_operator: "Equals",
24
- category_expression: "contact_form",
25
- label_operator: "Equals",
26
- label_expression: "lower_button",
27
- value_operator: "Equals",
28
- value: "1"
29
- }
30
- }
31
- )
32
-
33
- expect(conversion_goals).to include(
34
- conversion_goal_ids: [a_kind_of(Integer)],
35
- partial_errors: ""
36
- )
37
-
38
- puts "Please fill in examples.rb with conversion_goal_id: #{conversion_goals[:conversion_goal_ids].first}"
39
- end
40
- end
@@ -1,56 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "CampaignManagement service" do
4
- include_context "use api"
5
-
6
- describe "UET methods" do
7
- let(:get_uet_tags_by_ids) do
8
- api.campaign_management.get_uet_tags_by_ids(
9
- tag_ids: [
10
- {long: Examples.uet_tag_id}
11
- ]
12
- )
13
- end
14
-
15
- describe "#get_uet_tags_by_ids" do
16
- it "returns a list of UET tags" do
17
- expect(get_uet_tags_by_ids).to contain_exactly(
18
- {
19
- description: a_kind_of(String),
20
- id: a_kind_of(String),
21
- name: a_string_starting_with("Acceptance Test UET Tag"),
22
- tracking_no_script: a_string_starting_with("<img src=\"//bat.bing.com/action/"),
23
- tracking_script: a_string_starting_with("<script>(function(w,d,t,r,u)"),
24
- tracking_status: "Unverified",
25
- customer_share: nil
26
- }
27
- )
28
- end
29
- end
30
-
31
- describe "#update_uet_tags" do
32
- subject do
33
- api.campaign_management.update_uet_tags({
34
- uet_tags: [
35
- {
36
- uet_tag: {
37
- name: "Acceptance Test UET Tag - #{random}",
38
- id: Examples.uet_tag_id,
39
- description: "UET Tag Description - #{random}"
40
- }
41
- }
42
- ]
43
- })
44
- end
45
-
46
- it "updates the UET tag fields" do
47
- is_expected.to eq(partial_errors: "")
48
-
49
- expect(get_uet_tags_by_ids.first).to include(
50
- name: "Acceptance Test UET Tag - #{random}",
51
- description: "UET Tag Description - #{random}"
52
- )
53
- end
54
- end
55
- end
56
- end
@@ -1,76 +0,0 @@
1
- require_relative "../examples"
2
-
3
- RSpec.describe "Conversion goals methods" do
4
- include_context "use api"
5
-
6
- let(:a_conversion_goal) do
7
- {
8
- conversion_window_in_minutes: a_kind_of(String),
9
- count_type: a_kind_of(String),
10
- id: a_kind_of(String),
11
- name: a_string_starting_with("Acceptance Test Conversion goal"),
12
- revenue: a_kind_of(Hash),
13
- scope: a_kind_of(String),
14
- status: a_kind_of(String),
15
- tag_id: Examples.uet_tag_id.to_s,
16
- tracking_status: a_kind_of(String),
17
- type: "Event",
18
- action_expression: a_kind_of(String),
19
- action_operator: a_kind_of(String),
20
- category_expression: a_kind_of(String),
21
- category_operator: a_kind_of(String),
22
- label_expression: a_kind_of(String),
23
- label_operator: a_kind_of(String),
24
- value: a_kind_of(String),
25
- value_operator: a_kind_of(String),
26
- exclude_from_bidding: nil
27
- }
28
- end
29
-
30
- describe "#get_conversion_goals_by_ids" do
31
- it "returns a list of conversion goals" do
32
- expect(api.campaign_management.get_conversion_goals_by_ids(
33
- conversion_goal_types: "Event",
34
- conversion_goal_ids: [{long: Examples.conversion_goal_id}]
35
- )).to contain_exactly(a_conversion_goal)
36
- end
37
- end
38
-
39
- describe "#get_conversion_goals_by_tag_ids" do
40
- it "returns a list of conversion_goals" do
41
- expect(api.campaign_management.call(:get_conversion_goals_by_tag_ids, {
42
- conversion_goal_types: "Event",
43
- tag_ids: [long: Examples.uet_tag_id]
44
- })).to include(
45
- conversion_goals: {
46
- conversion_goal: a_collection_including(a_conversion_goal)
47
- },
48
- partial_errors: ""
49
- )
50
- end
51
- end
52
-
53
- describe "#update_conversion_goals" do
54
- it "updates the conversion goals" do
55
- expect(
56
- api.campaign_management.update_conversion_goals(
57
- conversion_goals: {
58
- event_goal: {
59
- id: Examples.conversion_goal_id,
60
- name: "Acceptance Test Conversion goal #{random}"
61
- }
62
- }
63
- )
64
- ).to eq(partial_errors: "")
65
-
66
- updated_conversion = api.campaign_management.get_conversion_goals_by_ids(
67
- conversion_goal_types: "Event",
68
- conversion_goal_ids: [{long: Examples.conversion_goal_id}]
69
- ).first
70
-
71
- expect(updated_conversion).to include(
72
- name: "Acceptance Test Conversion goal #{random}"
73
- )
74
- end
75
- end
76
- end