soapy_bing 0.3.1 → 0.4.0

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.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/Gemfile +1 -0
  4. data/README.md +18 -18
  5. data/Rakefile +1 -0
  6. data/lib/soapy_bing.rb +5 -1
  7. data/lib/soapy_bing/account.rb +1 -0
  8. data/lib/soapy_bing/accounts.rb +13 -17
  9. data/lib/soapy_bing/ads.rb +18 -41
  10. data/lib/soapy_bing/ads/campaign_performance_report.rb +49 -0
  11. data/lib/soapy_bing/ads/campaigns.rb +106 -0
  12. data/lib/soapy_bing/ads/parsers/bulk_csv_parser.rb +34 -0
  13. data/lib/soapy_bing/ads/parsers/report_csv_parser.rb +45 -0
  14. data/lib/soapy_bing/ads/report.rb +93 -0
  15. data/lib/soapy_bing/campaign_management.rb +21 -0
  16. data/lib/soapy_bing/country_codes.rb +17 -0
  17. data/lib/soapy_bing/country_codes.yml +727 -0
  18. data/lib/soapy_bing/customer.rb +1 -0
  19. data/lib/soapy_bing/helpers.rb +1 -1
  20. data/lib/soapy_bing/helpers/zip_downloader.rb +1 -0
  21. data/lib/soapy_bing/oauth_credentials.rb +1 -0
  22. data/lib/soapy_bing/param_guard.rb +1 -0
  23. data/lib/soapy_bing/service.rb +69 -0
  24. data/lib/soapy_bing/service_operation.rb +62 -0
  25. data/lib/soapy_bing/version.rb +2 -1
  26. data/lib/soapy_bing/wsdl/ad_insight.wsdl +1 -0
  27. data/lib/soapy_bing/wsdl/bulk.wsdl +1 -0
  28. data/lib/soapy_bing/wsdl/campaign_management.wsdl +1 -0
  29. data/lib/soapy_bing/wsdl/customer_billing.wsdl +1 -0
  30. data/lib/soapy_bing/wsdl/customer_management.wsdl +1 -0
  31. data/lib/soapy_bing/wsdl/reporting.wsdl +1 -0
  32. data/lib/tasks/console.rake +1 -0
  33. data/lib/tasks/coverage.rake +1 -0
  34. data/lib/tasks/spec.rake +1 -0
  35. data/lib/tasks/upate_wsdl_files.rake +23 -0
  36. data/lib/tasks/update_country_codes.rake +24 -0
  37. data/soapy_bing.gemspec +2 -1
  38. data/spec/fixtures/ads/campaign_performance_report.csv +37 -0
  39. data/spec/fixtures/ads/campaign_performance_report.json +170 -0
  40. data/spec/fixtures/ads/campaigns_by_account_id.csv +7 -0
  41. data/spec/fixtures/{bulk/campaigns.json → ads/campaigns_by_account_id.json} +496 -240
  42. data/spec/fixtures/ads/campaigns_by_campaign_ids.csv +5 -0
  43. data/spec/fixtures/ads/campaigns_by_campaign_ids.json +910 -0
  44. data/spec/fixtures/vcr_cassettes/SoapyBing_Accounts/_list/returns_a_list_of_SoapyBing_Account_objects.yml +27 -27
  45. data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_campaigns/by_account_id/returns_parsed_rows.yml +301 -0
  46. data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_campaigns/by_campaign_ids/returns_parsed_rows.yml +300 -0
  47. data/spec/fixtures/vcr_cassettes/SoapyBing_CampaignManagement/_get_geo_locations/returns_a_list_of_geo_locations_hashes.yml +154 -0
  48. data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_pending_status.yml +65 -94
  49. data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_empty_response.yml +511 -0
  50. data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_response.yml +384 -0
  51. data/spec/integration/soapy_bing/accounts_spec.rb +1 -0
  52. data/spec/integration/soapy_bing/ads_campaigns_spec.rb +85 -0
  53. data/spec/integration/soapy_bing/campaign_management_spec.rb +22 -0
  54. data/spec/integration/soapy_bing/oauth_credentials_spec.rb +1 -0
  55. data/spec/simplecov_setup.rb +1 -0
  56. data/spec/soapy_bing/account_spec.rb +6 -2
  57. data/spec/soapy_bing/accounts_spec.rb +47 -0
  58. data/spec/soapy_bing/ads/campaign_performance_report_spec.rb +79 -0
  59. data/spec/soapy_bing/ads/campaigns_spec.rb +99 -0
  60. data/spec/soapy_bing/ads/{bulk/parsers/csv_parser_spec.rb → parsers/bulk_csv_parser_spec.rb} +5 -4
  61. data/spec/soapy_bing/ads/{reports/parsers/csv_parser_spec.rb → parsers/report_csv_parser_spec.rb} +6 -4
  62. data/spec/soapy_bing/country_codes_spec.rb +39 -0
  63. data/spec/soapy_bing/helpers/zip_downloader_spec.rb +2 -0
  64. data/spec/soapy_bing/oauth_credentials_spec.rb +6 -2
  65. data/spec/soapy_bing/param_guard_spec.rb +2 -0
  66. data/spec/soapy_bing/service_spec.rb +56 -0
  67. data/spec/spec_helper.rb +1 -0
  68. data/spec/support/dotenv.rb +1 -0
  69. data/spec/support/vcr.rb +75 -6
  70. metadata +74 -118
  71. data/lib/soapy_bing/ads/bulk.rb +0 -3
  72. data/lib/soapy_bing/ads/bulk/campaigns.rb +0 -65
  73. data/lib/soapy_bing/ads/bulk/parsers.rb +0 -2
  74. data/lib/soapy_bing/ads/bulk/parsers/csv_parser.rb +0 -35
  75. data/lib/soapy_bing/ads/reports.rb +0 -4
  76. data/lib/soapy_bing/ads/reports/base.rb +0 -74
  77. data/lib/soapy_bing/ads/reports/campaign_performance_report.rb +0 -24
  78. data/lib/soapy_bing/ads/reports/parsers.rb +0 -2
  79. data/lib/soapy_bing/ads/reports/parsers/csv_parser.rb +0 -46
  80. data/lib/soapy_bing/helpers/class_name.rb +0 -10
  81. data/lib/soapy_bing/soap.rb +0 -4
  82. data/lib/soapy_bing/soap/request.rb +0 -10
  83. data/lib/soapy_bing/soap/request/base.rb +0 -38
  84. data/lib/soapy_bing/soap/request/download_campaigns_by_account_ids_request.rb +0 -17
  85. data/lib/soapy_bing/soap/request/get_accounts_info_request.rb +0 -17
  86. data/lib/soapy_bing/soap/request/get_ad_groups_by_campaign_id_request.rb +0 -17
  87. data/lib/soapy_bing/soap/request/get_ads_by_ad_group_id_request.rb +0 -17
  88. data/lib/soapy_bing/soap/request/get_bulk_download_status_request.rb +0 -17
  89. data/lib/soapy_bing/soap/request/get_targets_by_campaign_ids_request.rb +0 -17
  90. data/lib/soapy_bing/soap/request/poll_generate_report_request.rb +0 -34
  91. data/lib/soapy_bing/soap/request/submit_generate_report_request.rb +0 -17
  92. data/lib/soapy_bing/soap/response.rb +0 -14
  93. data/lib/soapy_bing/soap/response/base.rb +0 -17
  94. data/lib/soapy_bing/soap/response/download_campaigns_by_account_ids_response.rb +0 -12
  95. data/lib/soapy_bing/soap/response/get_accounts_info_response.rb +0 -12
  96. data/lib/soapy_bing/soap/response/get_ad_groups_by_campaign_id_response.rb +0 -12
  97. data/lib/soapy_bing/soap/response/get_ads_by_ad_group_id_response.rb +0 -12
  98. data/lib/soapy_bing/soap/response/get_bulk_download_status_response.rb +0 -17
  99. data/lib/soapy_bing/soap/response/get_targets_by_campaign_ids_response.rb +0 -12
  100. data/lib/soapy_bing/soap/response/payload.rb +0 -28
  101. data/lib/soapy_bing/soap/response/poll_generate_report_response.rb +0 -14
  102. data/lib/soapy_bing/soap/response/report_status.rb +0 -34
  103. data/lib/soapy_bing/soap/response/submit_generate_report_response.rb +0 -12
  104. data/lib/soapy_bing/soap/template_renderer.rb +0 -22
  105. data/lib/soapy_bing/soap/templates/download_campaigns_by_account_ids.xml.erb +0 -22
  106. data/lib/soapy_bing/soap/templates/get_accounts_info.xml.erb +0 -12
  107. data/lib/soapy_bing/soap/templates/get_ad_groups_by_campaign_id.xml.erb +0 -15
  108. data/lib/soapy_bing/soap/templates/get_ads_by_ad_group_id.xml.erb +0 -15
  109. data/lib/soapy_bing/soap/templates/get_bulk_download_status.xml.erb +0 -15
  110. data/lib/soapy_bing/soap/templates/get_targets_by_campaign_ids.xml.erb +0 -20
  111. data/lib/soapy_bing/soap/templates/poll_generate_report.xml.erb +0 -18
  112. data/lib/soapy_bing/soap/templates/submit_generate_report.xml.erb +0 -46
  113. data/spec/fixtures/bulk/campaigns.csv +0 -8
  114. data/spec/fixtures/get_ad_groups_by_campaign_id.json +0 -587
  115. data/spec/fixtures/get_ads_by_ad_group_id.json +0 -218
  116. data/spec/fixtures/get_targets_by_campaign_ids.json +0 -81
  117. data/spec/fixtures/reports/campaign_performance_report.csv +0 -37
  118. data/spec/fixtures/reports/campaign_performance_report.json +0 -146
  119. data/spec/fixtures/soap_templates/simple.xml.erb +0 -2
  120. data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ad_groups_by_campaign_id/1_1_1.yml +0 -150
  121. data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ads_by_ad_group_id/1_2_1.yml +0 -141
  122. data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_targets_by_campaign_ids/1_3_1.yml +0 -111
  123. data/spec/fixtures/vcr_cassettes/SoapyBing_Ads_Bulk_Campaigns/_result_file_url/returns_result_file_url.yml +0 -216
  124. data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_status.yml +0 -284
  125. data/spec/integration/soapy_bing/ads/bulk/campaigns_spec.rb +0 -35
  126. data/spec/integration/soapy_bing/ads/reports/campaign_performance_report_spec.rb +0 -40
  127. data/spec/integration/soapy_bing/ads_spec.rb +0 -32
  128. data/spec/soapy_bing/ads/reports/campaign_performance_report_spec.rb +0 -42
  129. data/spec/soapy_bing/ads_spec.rb +0 -33
  130. data/spec/soapy_bing/helpers/class_name_spec.rb +0 -15
  131. data/spec/soapy_bing/soap/request/base_spec.rb +0 -55
  132. data/spec/soapy_bing/soap/request/poll_generate_report_request_spec.rb +0 -60
  133. data/spec/soapy_bing/soap/response/base_spec.rb +0 -13
  134. data/spec/soapy_bing/soap/response/get_bulk_download_status_response_spec.rb +0 -60
  135. data/spec/soapy_bing/soap/response/payload_spec.rb +0 -48
  136. data/spec/soapy_bing/soap/response/poll_generate_report_response_spec.rb +0 -26
  137. data/spec/soapy_bing/soap/response/report_status_spec.rb +0 -92
  138. data/spec/soapy_bing/soap/response/submit_generate_report_response_spec.rb +0 -20
  139. data/spec/soapy_bing/soap/template_renderer_spec.rb +0 -25
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Request
5
- class PollGenerateReportRequest < Base
6
- class FailedStatusError < StandardError; end
7
- class PendingStatusError < StandardError; end
8
- class PollingTimeoutError < StandardError; end
9
-
10
- API_BASE_URL = 'https://reporting.api.bingads.microsoft.com'
11
- API_VERSION = 9
12
- API_ENDPOINT =
13
- "#{API_BASE_URL}/Api/Advertiser/Reporting/V#{API_VERSION}/ReportingService.svc"
14
-
15
- POLLING_TRIES = 100
16
-
17
- def perform
18
- Retryable.retryable(tries: POLLING_TRIES, on: PendingStatusError) { poll! }
19
- rescue PendingStatusError
20
- raise PollingTimeoutError
21
- end
22
-
23
- private
24
-
25
- def poll!
26
- response = Response::PollGenerateReportResponse.new(post(API_ENDPOINT))
27
- raise PendingStatusError if response.pending?
28
- raise FailedStatusError if response.error?
29
- response
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Request
5
- class SubmitGenerateReportRequest < Base
6
- API_BASE_URL = 'https://reporting.api.bingads.microsoft.com'
7
- API_VERSION = 9
8
- API_ENDPOINT =
9
- "#{API_BASE_URL}/Api/Advertiser/Reporting/V#{API_VERSION}/ReportingService.svc"
10
-
11
- def perform
12
- Response::SubmitGenerateReportResponse.new(post(API_ENDPOINT))
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'active_support/core_ext/array/wrap'
3
-
4
- require 'soapy_bing/soap/response/payload'
5
- require 'soapy_bing/soap/response/report_status'
6
- require 'soapy_bing/soap/response/base'
7
- require 'soapy_bing/soap/response/submit_generate_report_response'
8
- require 'soapy_bing/soap/response/poll_generate_report_response'
9
- require 'soapy_bing/soap/response/get_ad_groups_by_campaign_id_response'
10
- require 'soapy_bing/soap/response/get_ads_by_ad_group_id_response'
11
- require 'soapy_bing/soap/response/get_targets_by_campaign_ids_response'
12
- require 'soapy_bing/soap/response/get_accounts_info_response'
13
- require 'soapy_bing/soap/response/download_campaigns_by_account_ids_response'
14
- require 'soapy_bing/soap/response/get_bulk_download_status_response'
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class Base
6
- include Helpers::ClassName
7
- include Payload
8
-
9
- attr_reader :body
10
-
11
- def initialize(body)
12
- @body = body
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class DownloadCampaignsByAccountIdsResponse < Base
6
- def extract_payload
7
- response['DownloadRequestId']
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class GetAccountsInfoResponse < Base
6
- def extract_payload
7
- Array.wrap(response['AccountsInfo']['AccountInfo'])
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class GetAdGroupsByCampaignIdResponse < Base
6
- def extract_payload
7
- Array.wrap(response['AdGroups']['AdGroup'])
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class GetAdsByAdGroupIdResponse < Base
6
- def extract_payload
7
- Array.wrap(response['Ads']['Ad'])
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class GetBulkDownloadStatusResponse < Base
6
- StatusFailed = Class.new(StandardError)
7
-
8
- def extract_payload
9
- if response['RequestStatus'] == 'Failed'
10
- raise StatusFailed, response['Errors'].to_s
11
- end
12
- response.slice('PercentComplete', 'RequestStatus', 'ResultFileUrl')
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class GetTargetsByCampaignIdsResponse < Base
6
- def extract_payload
7
- Array.wrap(response['Targets']['Target']).first
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- module Payload
6
- Fault = Class.new(StandardError)
7
-
8
- def payload
9
- @payload ||= check_errors_and_extract_payload
10
- end
11
-
12
- def check_errors_and_extract_payload
13
- fault = body.dig('Envelope', 'Body', 'Fault')
14
- raise Fault, fault.to_s if fault
15
- extract_payload
16
- end
17
-
18
- def extract_payload
19
- raise NotImplementedError
20
- end
21
-
22
- def response
23
- @response ||= body.dig('Envelope', 'Body', class_name)
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class PollGenerateReportResponse < Base
6
- include ReportStatus
7
-
8
- def extract_payload
9
- report_status['ReportDownloadUrl']
10
- end
11
- end
12
- end
13
- end
14
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- module ReportStatus
6
- include Helpers::ClassName
7
-
8
- def status
9
- @status ||= extract_status
10
- end
11
-
12
- def extract_status
13
- report_status['Status']
14
- end
15
-
16
- def report_status
17
- response['ReportRequestStatus']
18
- end
19
-
20
- def error?
21
- status == 'Error'
22
- end
23
-
24
- def success?
25
- status == 'Success'
26
- end
27
-
28
- def pending?
29
- status == 'Pending'
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- module SoapyBing
3
- module Soap
4
- module Response
5
- class SubmitGenerateReportResponse < Base
6
- def extract_payload
7
- response['ReportRequestId']
8
- end
9
- end
10
- end
11
- end
12
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
- require 'ostruct'
3
- require 'erubis'
4
-
5
- module SoapyBing
6
- module Soap
7
- class TemplateRenderer < OpenStruct
8
- TEMPLATE_PATH = File.expand_path('../templates', __FILE__)
9
-
10
- def render(template_name)
11
- template_body = read(template_name)
12
- Erubis::XmlEruby.new(template_body).result(binding)
13
- end
14
-
15
- private
16
-
17
- def read(name)
18
- File.read(File.join(TEMPLATE_PATH, "#{name}.xml.erb"))
19
- end
20
- end
21
- end
22
- end
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
3
- <s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
4
- <Action mustUnderstand="1">DownloadCampaignsByAccountIds</Action>
5
- <AuthenticationToken i:nil="false"><%= authentication_token %></AuthenticationToken>
6
- <CustomerAccountId i:nil="false"><%= account.account_id %></CustomerAccountId>
7
- <CustomerId i:nil="false"><%= account.customer_id %></CustomerId>
8
- <DeveloperToken i:nil="false"><%= account.developer_token %></DeveloperToken>
9
- </s:Header>
10
- <s:Body>
11
- <DownloadCampaignsByAccountIdsRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
12
- <AccountIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
13
- <a1:long><%= account.account_id %></a1:long>
14
- </AccountIds>
15
- <CompressionType i:nil="false">Zip</CompressionType>
16
- <DataScope>EntityData</DataScope>
17
- <DownloadFileType i:nil="false">Csv</DownloadFileType>
18
- <Entities><%= entities.join(' ') %></Entities>
19
- <FormatVersion i:nil="false">4.0</FormatVersion>
20
- </DownloadCampaignsByAccountIdsRequest>
21
- </s:Body>
22
- </s:Envelope>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
3
- <s:Header xmlns="https://bingads.microsoft.com/Customer/v9">
4
- <Action mustUnderstand="1">GetAccountsInfo</Action>
5
- <AuthenticationToken><%= authentication_token %></AuthenticationToken>
6
- <DeveloperToken><%= developer_token %></DeveloperToken>
7
- </s:Header>
8
- <s:Body>
9
- <GetAccountsInfoRequest xmlns="https://bingads.microsoft.com/Customer/v9">
10
- </GetAccountsInfoRequest>
11
- </s:Body>
12
- </s:Envelope>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <env:Envelope xmlns:tns="https://bingads.microsoft.com/CampaignManagement/v10"
3
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
4
- <env:Header>
5
- <tns:CustomerAccountId><%= account.account_id %></tns:CustomerAccountId>
6
- <tns:CustomerId><%= account.customer_id %></tns:CustomerId>
7
- <tns:DeveloperToken><%= account.developer_token %></tns:DeveloperToken>
8
- <tns:AuthenticationToken><%= authentication_token %></tns:AuthenticationToken>
9
- </env:Header>
10
- <env:Body>
11
- <tns:GetAdGroupsByCampaignIdRequest>
12
- <tns:CampaignId><%= campaign_id %></tns:CampaignId>
13
- </tns:GetAdGroupsByCampaignIdRequest>
14
- </env:Body>
15
- </env:Envelope>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <env:Envelope xmlns:tns="https://bingads.microsoft.com/CampaignManagement/v10"
3
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
4
- <env:Header>
5
- <tns:CustomerAccountId><%= account.account_id %></tns:CustomerAccountId>
6
- <tns:CustomerId><%= account.customer_id %></tns:CustomerId>
7
- <tns:DeveloperToken><%= account.developer_token %></tns:DeveloperToken>
8
- <tns:AuthenticationToken><%= authentication_token %></tns:AuthenticationToken>
9
- </env:Header>
10
- <env:Body>
11
- <tns:GetAdsByAdGroupIdRequest>
12
- <tns:AdGroupId><%= ad_group_id %></tns:AdGroupId>
13
- </tns:GetAdsByAdGroupIdRequest>
14
- </env:Body>
15
- </env:Envelope>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
3
- <s:Header xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
4
- <Action mustUnderstand="1">GetBulkDownloadStatus</Action>
5
- <AuthenticationToken i:nil="false"><%= authentication_token %></AuthenticationToken>
6
- <CustomerAccountId i:nil="false"><%= account.account_id %></CustomerAccountId>
7
- <CustomerId i:nil="false"><%= account.customer_id %></CustomerId>
8
- <DeveloperToken i:nil="false"><%= account.developer_token %></DeveloperToken>
9
- </s:Header>
10
- <s:Body>
11
- <GetBulkDownloadStatusRequest xmlns="https://bingads.microsoft.com/CampaignManagement/v10">
12
- <RequestId i:nil="false"><%= request_id %></RequestId>
13
- </GetBulkDownloadStatusRequest>
14
- </s:Body>
15
- </s:Envelope>
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <env:Envelope xmlns:tns="https://bingads.microsoft.com/CampaignManagement/v10"
3
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
4
- xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
5
- <env:Header>
6
- <tns:CustomerAccountId><%= account.account_id %></tns:CustomerAccountId>
7
- <tns:CustomerId><%= account.customer_id %></tns:CustomerId>
8
- <tns:DeveloperToken><%= account.developer_token %></tns:DeveloperToken>
9
- <tns:AuthenticationToken><%= authentication_token %></tns:AuthenticationToken>
10
- </env:Header>
11
- <env:Body>
12
- <tns:GetTargetsByCampaignIdsRequest>
13
- <tns:CampaignIds>
14
- <% campaign_ids.each do |campaign_id| %>
15
- <arr:long><%= campaign_id %></arr:long>
16
- <% end %>
17
- </tns:CampaignIds>
18
- </tns:GetTargetsByCampaignIdsRequest>
19
- </env:Body>
20
- </env:Envelope>
@@ -1,18 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xmlns:tns="https://bingads.microsoft.com/Reporting/v9"
5
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
6
- xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
7
- <env:Header>
8
- <tns:CustomerAccountId><%= account.account_id %></tns:CustomerAccountId>
9
- <tns:CustomerId><%= account.customer_id %></tns:CustomerId>
10
- <tns:DeveloperToken><%= account.developer_token %></tns:DeveloperToken>
11
- <tns:AuthenticationToken><%= authentication_token %></tns:AuthenticationToken>
12
- </env:Header>
13
- <env:Body>
14
- <tns:PollGenerateReportRequest>
15
- <tns:ReportRequestId xsi:nil="false"><%= request_id %></tns:ReportRequestId>
16
- </tns:PollGenerateReportRequest>
17
- </env:Body>
18
- </env:Envelope>
@@ -1,46 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
- xmlns:tns="https://bingads.microsoft.com/Reporting/v9"
5
- xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
6
- xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
7
- <env:Header>
8
- <tns:CustomerAccountId><%= account.account_id %></tns:CustomerAccountId>
9
- <tns:CustomerId><%= account.customer_id %></tns:CustomerId>
10
- <tns:DeveloperToken><%= account.developer_token %></tns:DeveloperToken>
11
- <tns:AuthenticationToken><%= authentication_token %></tns:AuthenticationToken>
12
- </env:Header>
13
- <env:Body>
14
- <tns:SubmitGenerateReportRequest>
15
- <tns:ReportRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:type="tns:<%= report_class %>Request">
16
- <tns:Format><%= settings.format %></tns:Format>
17
- <tns:Language><%= settings.language %></tns:Language>
18
- <tns:ReportName><%= settings.name %></tns:ReportName>
19
- <tns:ReturnOnlyCompleteData>false</tns:ReturnOnlyCompleteData>
20
- <tns:Aggregation><%= settings.aggregation %></tns:Aggregation>
21
- <tns:Columns>
22
- <% settings.columns.each do |column| %>
23
- <tns:<%= report_class %>Column><%= column %></tns:<%= report_class %>Column>
24
- <% end %>
25
- </tns:Columns>
26
- <tns:Scope>
27
- <tns:AccountIds>
28
- <arr:long><%= account.account_id %></arr:long>
29
- </tns:AccountIds>
30
- </tns:Scope>
31
- <tns:Time>
32
- <tns:CustomDateRangeEnd>
33
- <tns:Day><%= date_range.end.day %></tns:Day>
34
- <tns:Month><%= date_range.end.month %></tns:Month>
35
- <tns:Year><%= date_range.end.year %></tns:Year>
36
- </tns:CustomDateRangeEnd>
37
- <tns:CustomDateRangeStart>
38
- <tns:Day><%= date_range.begin.day %></tns:Day>
39
- <tns:Month><%= date_range.begin.month %></tns:Month>
40
- <tns:Year><%= date_range.begin.year %></tns:Year>
41
- </tns:CustomDateRangeStart>
42
- </tns:Time>
43
- </tns:ReportRequest>
44
- </tns:SubmitGenerateReportRequest>
45
- </env:Body>
46
- </env:Envelope>