soapy_bing 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +1 -0
- data/README.md +18 -18
- data/Rakefile +1 -0
- data/lib/soapy_bing.rb +5 -1
- data/lib/soapy_bing/account.rb +1 -0
- data/lib/soapy_bing/accounts.rb +13 -17
- data/lib/soapy_bing/ads.rb +18 -41
- data/lib/soapy_bing/ads/campaign_performance_report.rb +49 -0
- data/lib/soapy_bing/ads/campaigns.rb +106 -0
- data/lib/soapy_bing/ads/parsers/bulk_csv_parser.rb +34 -0
- data/lib/soapy_bing/ads/parsers/report_csv_parser.rb +45 -0
- data/lib/soapy_bing/ads/report.rb +93 -0
- data/lib/soapy_bing/campaign_management.rb +21 -0
- data/lib/soapy_bing/country_codes.rb +17 -0
- data/lib/soapy_bing/country_codes.yml +727 -0
- data/lib/soapy_bing/customer.rb +1 -0
- data/lib/soapy_bing/helpers.rb +1 -1
- data/lib/soapy_bing/helpers/zip_downloader.rb +1 -0
- data/lib/soapy_bing/oauth_credentials.rb +1 -0
- data/lib/soapy_bing/param_guard.rb +1 -0
- data/lib/soapy_bing/service.rb +69 -0
- data/lib/soapy_bing/service_operation.rb +62 -0
- data/lib/soapy_bing/version.rb +2 -1
- data/lib/soapy_bing/wsdl/ad_insight.wsdl +1 -0
- data/lib/soapy_bing/wsdl/bulk.wsdl +1 -0
- data/lib/soapy_bing/wsdl/campaign_management.wsdl +1 -0
- data/lib/soapy_bing/wsdl/customer_billing.wsdl +1 -0
- data/lib/soapy_bing/wsdl/customer_management.wsdl +1 -0
- data/lib/soapy_bing/wsdl/reporting.wsdl +1 -0
- data/lib/tasks/console.rake +1 -0
- data/lib/tasks/coverage.rake +1 -0
- data/lib/tasks/spec.rake +1 -0
- data/lib/tasks/upate_wsdl_files.rake +23 -0
- data/lib/tasks/update_country_codes.rake +24 -0
- data/soapy_bing.gemspec +2 -1
- data/spec/fixtures/ads/campaign_performance_report.csv +37 -0
- data/spec/fixtures/ads/campaign_performance_report.json +170 -0
- data/spec/fixtures/ads/campaigns_by_account_id.csv +7 -0
- data/spec/fixtures/{bulk/campaigns.json → ads/campaigns_by_account_id.json} +496 -240
- data/spec/fixtures/ads/campaigns_by_campaign_ids.csv +5 -0
- data/spec/fixtures/ads/campaigns_by_campaign_ids.json +910 -0
- data/spec/fixtures/vcr_cassettes/SoapyBing_Accounts/_list/returns_a_list_of_SoapyBing_Account_objects.yml +27 -27
- data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_campaigns/by_account_id/returns_parsed_rows.yml +301 -0
- data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_campaigns/by_campaign_ids/returns_parsed_rows.yml +300 -0
- data/spec/fixtures/vcr_cassettes/SoapyBing_CampaignManagement/_get_geo_locations/returns_a_list_of_geo_locations_hashes.yml +154 -0
- data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_pending_status.yml +65 -94
- data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_empty_response.yml +511 -0
- data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_response.yml +384 -0
- data/spec/integration/soapy_bing/accounts_spec.rb +1 -0
- data/spec/integration/soapy_bing/ads_campaigns_spec.rb +85 -0
- data/spec/integration/soapy_bing/campaign_management_spec.rb +22 -0
- data/spec/integration/soapy_bing/oauth_credentials_spec.rb +1 -0
- data/spec/simplecov_setup.rb +1 -0
- data/spec/soapy_bing/account_spec.rb +6 -2
- data/spec/soapy_bing/accounts_spec.rb +47 -0
- data/spec/soapy_bing/ads/campaign_performance_report_spec.rb +79 -0
- data/spec/soapy_bing/ads/campaigns_spec.rb +99 -0
- data/spec/soapy_bing/ads/{bulk/parsers/csv_parser_spec.rb → parsers/bulk_csv_parser_spec.rb} +5 -4
- data/spec/soapy_bing/ads/{reports/parsers/csv_parser_spec.rb → parsers/report_csv_parser_spec.rb} +6 -4
- data/spec/soapy_bing/country_codes_spec.rb +39 -0
- data/spec/soapy_bing/helpers/zip_downloader_spec.rb +2 -0
- data/spec/soapy_bing/oauth_credentials_spec.rb +6 -2
- data/spec/soapy_bing/param_guard_spec.rb +2 -0
- data/spec/soapy_bing/service_spec.rb +56 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/dotenv.rb +1 -0
- data/spec/support/vcr.rb +75 -6
- metadata +74 -118
- data/lib/soapy_bing/ads/bulk.rb +0 -3
- data/lib/soapy_bing/ads/bulk/campaigns.rb +0 -65
- data/lib/soapy_bing/ads/bulk/parsers.rb +0 -2
- data/lib/soapy_bing/ads/bulk/parsers/csv_parser.rb +0 -35
- data/lib/soapy_bing/ads/reports.rb +0 -4
- data/lib/soapy_bing/ads/reports/base.rb +0 -74
- data/lib/soapy_bing/ads/reports/campaign_performance_report.rb +0 -24
- data/lib/soapy_bing/ads/reports/parsers.rb +0 -2
- data/lib/soapy_bing/ads/reports/parsers/csv_parser.rb +0 -46
- data/lib/soapy_bing/helpers/class_name.rb +0 -10
- data/lib/soapy_bing/soap.rb +0 -4
- data/lib/soapy_bing/soap/request.rb +0 -10
- data/lib/soapy_bing/soap/request/base.rb +0 -38
- data/lib/soapy_bing/soap/request/download_campaigns_by_account_ids_request.rb +0 -17
- data/lib/soapy_bing/soap/request/get_accounts_info_request.rb +0 -17
- data/lib/soapy_bing/soap/request/get_ad_groups_by_campaign_id_request.rb +0 -17
- data/lib/soapy_bing/soap/request/get_ads_by_ad_group_id_request.rb +0 -17
- data/lib/soapy_bing/soap/request/get_bulk_download_status_request.rb +0 -17
- data/lib/soapy_bing/soap/request/get_targets_by_campaign_ids_request.rb +0 -17
- data/lib/soapy_bing/soap/request/poll_generate_report_request.rb +0 -34
- data/lib/soapy_bing/soap/request/submit_generate_report_request.rb +0 -17
- data/lib/soapy_bing/soap/response.rb +0 -14
- data/lib/soapy_bing/soap/response/base.rb +0 -17
- data/lib/soapy_bing/soap/response/download_campaigns_by_account_ids_response.rb +0 -12
- data/lib/soapy_bing/soap/response/get_accounts_info_response.rb +0 -12
- data/lib/soapy_bing/soap/response/get_ad_groups_by_campaign_id_response.rb +0 -12
- data/lib/soapy_bing/soap/response/get_ads_by_ad_group_id_response.rb +0 -12
- data/lib/soapy_bing/soap/response/get_bulk_download_status_response.rb +0 -17
- data/lib/soapy_bing/soap/response/get_targets_by_campaign_ids_response.rb +0 -12
- data/lib/soapy_bing/soap/response/payload.rb +0 -28
- data/lib/soapy_bing/soap/response/poll_generate_report_response.rb +0 -14
- data/lib/soapy_bing/soap/response/report_status.rb +0 -34
- data/lib/soapy_bing/soap/response/submit_generate_report_response.rb +0 -12
- data/lib/soapy_bing/soap/template_renderer.rb +0 -22
- data/lib/soapy_bing/soap/templates/download_campaigns_by_account_ids.xml.erb +0 -22
- data/lib/soapy_bing/soap/templates/get_accounts_info.xml.erb +0 -12
- data/lib/soapy_bing/soap/templates/get_ad_groups_by_campaign_id.xml.erb +0 -15
- data/lib/soapy_bing/soap/templates/get_ads_by_ad_group_id.xml.erb +0 -15
- data/lib/soapy_bing/soap/templates/get_bulk_download_status.xml.erb +0 -15
- data/lib/soapy_bing/soap/templates/get_targets_by_campaign_ids.xml.erb +0 -20
- data/lib/soapy_bing/soap/templates/poll_generate_report.xml.erb +0 -18
- data/lib/soapy_bing/soap/templates/submit_generate_report.xml.erb +0 -46
- data/spec/fixtures/bulk/campaigns.csv +0 -8
- data/spec/fixtures/get_ad_groups_by_campaign_id.json +0 -587
- data/spec/fixtures/get_ads_by_ad_group_id.json +0 -218
- data/spec/fixtures/get_targets_by_campaign_ids.json +0 -81
- data/spec/fixtures/reports/campaign_performance_report.csv +0 -37
- data/spec/fixtures/reports/campaign_performance_report.json +0 -146
- data/spec/fixtures/soap_templates/simple.xml.erb +0 -2
- data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ad_groups_by_campaign_id/1_1_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_ads_by_ad_group_id/1_2_1.yml +0 -141
- data/spec/fixtures/vcr_cassettes/SoapyBing_Ads/_get_targets_by_campaign_ids/1_3_1.yml +0 -111
- data/spec/fixtures/vcr_cassettes/SoapyBing_Ads_Bulk_Campaigns/_result_file_url/returns_result_file_url.yml +0 -216
- data/spec/fixtures/vcr_cassettes/campaign_performance_report/with_successful_status.yml +0 -284
- data/spec/integration/soapy_bing/ads/bulk/campaigns_spec.rb +0 -35
- data/spec/integration/soapy_bing/ads/reports/campaign_performance_report_spec.rb +0 -40
- data/spec/integration/soapy_bing/ads_spec.rb +0 -32
- data/spec/soapy_bing/ads/reports/campaign_performance_report_spec.rb +0 -42
- data/spec/soapy_bing/ads_spec.rb +0 -33
- data/spec/soapy_bing/helpers/class_name_spec.rb +0 -15
- data/spec/soapy_bing/soap/request/base_spec.rb +0 -55
- data/spec/soapy_bing/soap/request/poll_generate_report_request_spec.rb +0 -60
- data/spec/soapy_bing/soap/response/base_spec.rb +0 -13
- data/spec/soapy_bing/soap/response/get_bulk_download_status_response_spec.rb +0 -60
- data/spec/soapy_bing/soap/response/payload_spec.rb +0 -48
- data/spec/soapy_bing/soap/response/poll_generate_report_response_spec.rb +0 -26
- data/spec/soapy_bing/soap/response/report_status_spec.rb +0 -92
- data/spec/soapy_bing/soap/response/submit_generate_report_response_spec.rb +0 -20
- data/spec/soapy_bing/soap/template_renderer_spec.rb +0 -25
data/lib/soapy_bing/ads/bulk.rb
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
class Ads
|
4
|
-
module Bulk
|
5
|
-
class Campaigns
|
6
|
-
DEFAULT_ENTITIES = %w(CampaignTargets Ads).freeze
|
7
|
-
DEFAULT_POLLING_SETTINGS = {
|
8
|
-
tries: 20,
|
9
|
-
sleep: ->(n) { n < 7 ? 2**n : 120 }
|
10
|
-
}.freeze
|
11
|
-
NotCompleted = Class.new(StandardError)
|
12
|
-
|
13
|
-
attr_reader :oauth_credentials, :account, :entities, :polling_settings, :status
|
14
|
-
|
15
|
-
def initialize(options)
|
16
|
-
@oauth_credentials = options.fetch(:oauth_credentials)
|
17
|
-
@account = options.fetch(:account)
|
18
|
-
@entities = options.fetch(:entities) || DEFAULT_ENTITIES
|
19
|
-
@polling_settings = DEFAULT_POLLING_SETTINGS.merge(options.fetch(:polling_settings) || {})
|
20
|
-
end
|
21
|
-
|
22
|
-
def rows
|
23
|
-
@rows ||= Parsers::CSVParser.new(Helpers::ZipDownloader.new(result_file_url).read).rows
|
24
|
-
end
|
25
|
-
|
26
|
-
def result_file_url
|
27
|
-
@result_file_url ||= begin
|
28
|
-
wait_status_complete
|
29
|
-
status['ResultFileUrl']
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def fetch_status
|
34
|
-
@status = Soap::Request::GetBulkDownloadStatusRequest
|
35
|
-
.new(context: context.merge(request_id: download_request_id))
|
36
|
-
.perform
|
37
|
-
.payload
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def wait_status_complete
|
43
|
-
Retryable.retryable(polling_settings.merge(on: NotCompleted)) do
|
44
|
-
fetch_status
|
45
|
-
raise NotCompleted if status['RequestStatus'] != 'Completed'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def download_request_id
|
50
|
-
@download_request_id ||= Soap::Request::DownloadCampaignsByAccountIdsRequest
|
51
|
-
.new(context: context.merge(entities: entities))
|
52
|
-
.perform
|
53
|
-
.payload
|
54
|
-
end
|
55
|
-
|
56
|
-
def context
|
57
|
-
{
|
58
|
-
account: account,
|
59
|
-
authentication_token: oauth_credentials.access_token
|
60
|
-
}
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'csv'
|
3
|
-
|
4
|
-
module SoapyBing
|
5
|
-
class Ads
|
6
|
-
module Bulk
|
7
|
-
module Parsers
|
8
|
-
class CSVParser
|
9
|
-
def initialize(raw)
|
10
|
-
@raw = raw
|
11
|
-
end
|
12
|
-
|
13
|
-
def rows
|
14
|
-
@rows ||= begin
|
15
|
-
header, *body = extract_csv_payload
|
16
|
-
body.map { |row| header.zip(row).to_h }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
attr_reader :raw
|
23
|
-
|
24
|
-
def extract_csv_payload
|
25
|
-
text = raw.dup
|
26
|
-
text.force_encoding(Encoding::UTF_8).encode! unless text.encoding == Encoding::UTF_8
|
27
|
-
text.sub!(/^\xEF\xBB\xBF/, '') # cleanup BOM
|
28
|
-
|
29
|
-
CSV.parse(text)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,74 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'ostruct'
|
3
|
-
|
4
|
-
module SoapyBing
|
5
|
-
class Ads
|
6
|
-
module Reports
|
7
|
-
class Base
|
8
|
-
class UnknownParserError < StandardError; end
|
9
|
-
include Helpers::ClassName
|
10
|
-
|
11
|
-
DEFAULT_REPORT_SETTINGS = {
|
12
|
-
format: 'Csv',
|
13
|
-
language: 'English',
|
14
|
-
name: 'MyReport',
|
15
|
-
aggregation: 'HourOfDay',
|
16
|
-
columns: %w(TimePeriod CampaignName Impressions Clicks Spend CampaignId)
|
17
|
-
}.freeze
|
18
|
-
|
19
|
-
attr_reader :oauth_credentials, :account, :settings
|
20
|
-
|
21
|
-
def initialize(options)
|
22
|
-
@oauth_credentials = options.fetch(:oauth_credentials)
|
23
|
-
@account = options.fetch(:account)
|
24
|
-
@settings = OpenStruct.new(DEFAULT_REPORT_SETTINGS.merge(options.fetch(:settings, {})))
|
25
|
-
end
|
26
|
-
|
27
|
-
def rows
|
28
|
-
@rows ||= parser_class.new(Helpers::ZipDownloader.new(download_url).read).rows
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def parser_class
|
34
|
-
class_name = "#{settings.format.upcase}Parser".to_sym
|
35
|
-
raise UnknownParserError, class_name unless Parsers.constants.include?(class_name)
|
36
|
-
Parsers.const_get class_name
|
37
|
-
end
|
38
|
-
|
39
|
-
def download_url
|
40
|
-
@url ||=
|
41
|
-
Soap::Request::PollGenerateReportRequest
|
42
|
-
.new(context: poll_generate_report_context)
|
43
|
-
.perform
|
44
|
-
.payload
|
45
|
-
end
|
46
|
-
|
47
|
-
def poll_generate_report_context
|
48
|
-
{
|
49
|
-
account: account,
|
50
|
-
authentication_token: oauth_credentials.access_token,
|
51
|
-
request_id: request_id
|
52
|
-
}
|
53
|
-
end
|
54
|
-
|
55
|
-
def request_id
|
56
|
-
@request_id ||=
|
57
|
-
Soap::Request::SubmitGenerateReportRequest
|
58
|
-
.new(context: submit_generate_report_context)
|
59
|
-
.perform
|
60
|
-
.payload
|
61
|
-
end
|
62
|
-
|
63
|
-
def submit_generate_report_context
|
64
|
-
{
|
65
|
-
account: account,
|
66
|
-
authentication_token: oauth_credentials.access_token,
|
67
|
-
settings: settings,
|
68
|
-
report_class: class_name
|
69
|
-
}
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'date'
|
3
|
-
|
4
|
-
module SoapyBing
|
5
|
-
class Ads
|
6
|
-
module Reports
|
7
|
-
class CampaignPerformanceReport < Base
|
8
|
-
attr_reader :date_range
|
9
|
-
|
10
|
-
def initialize(options)
|
11
|
-
super(options)
|
12
|
-
@date_range = Range.new(
|
13
|
-
Date.parse(options.fetch(:date_start)),
|
14
|
-
Date.parse(options.fetch(:date_end))
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
def submit_generate_report_context
|
19
|
-
super.merge(date_range: date_range)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'csv'
|
3
|
-
|
4
|
-
module SoapyBing
|
5
|
-
class Ads
|
6
|
-
module Reports
|
7
|
-
module Parsers
|
8
|
-
class CSVParser
|
9
|
-
class FormatError < StandardError; end
|
10
|
-
|
11
|
-
CSV_PAYLOAD_OFFSET_FRONT = 10 # First 10 csv lines are report metadata
|
12
|
-
CSV_PAYLOAD_OFFSET_BACK = 2 # Last 2 csv lines are Microsoft copyright
|
13
|
-
|
14
|
-
def initialize(raw)
|
15
|
-
@raw = raw
|
16
|
-
end
|
17
|
-
|
18
|
-
def rows
|
19
|
-
@rows ||= begin
|
20
|
-
header, *body = extract_csv_payload
|
21
|
-
raise FormatError if body.size != payload_rows_number
|
22
|
-
body.map { |row| header.zip(row).to_h }
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
attr_reader :raw
|
29
|
-
|
30
|
-
def extract_csv_payload
|
31
|
-
text = raw.dup
|
32
|
-
text.force_encoding(Encoding::UTF_8).encode! unless text.encoding == Encoding::UTF_8
|
33
|
-
text.sub!(/^\xEF\xBB\xBF/, '') # cleanup BOM
|
34
|
-
|
35
|
-
csv_rows = CSV.parse(text)
|
36
|
-
csv_rows[CSV_PAYLOAD_OFFSET_FRONT...-CSV_PAYLOAD_OFFSET_BACK]
|
37
|
-
end
|
38
|
-
|
39
|
-
def payload_rows_number
|
40
|
-
raw.match(/"Rows: (\d+)"/)[1].to_i
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
data/lib/soapy_bing/soap.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'soapy_bing/soap/request/base'
|
3
|
-
require 'soapy_bing/soap/request/submit_generate_report_request'
|
4
|
-
require 'soapy_bing/soap/request/poll_generate_report_request'
|
5
|
-
require 'soapy_bing/soap/request/get_ad_groups_by_campaign_id_request'
|
6
|
-
require 'soapy_bing/soap/request/get_ads_by_ad_group_id_request'
|
7
|
-
require 'soapy_bing/soap/request/get_targets_by_campaign_ids_request'
|
8
|
-
require 'soapy_bing/soap/request/get_accounts_info_request'
|
9
|
-
require 'soapy_bing/soap/request/download_campaigns_by_account_ids_request'
|
10
|
-
require 'soapy_bing/soap/request/get_bulk_download_status_request'
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'httparty'
|
3
|
-
|
4
|
-
module SoapyBing
|
5
|
-
module Soap
|
6
|
-
module Request
|
7
|
-
class Base
|
8
|
-
include Helpers::ClassName
|
9
|
-
|
10
|
-
DEFAULT_HTTP_HEADERS = {
|
11
|
-
'Content-Type' => 'text/xml;charset=UTF-8'
|
12
|
-
}.freeze
|
13
|
-
|
14
|
-
attr_reader :context
|
15
|
-
|
16
|
-
def initialize(context:)
|
17
|
-
@context = context
|
18
|
-
end
|
19
|
-
|
20
|
-
def post(url, body: default_body, headers: default_headers)
|
21
|
-
HTTParty.post(url, body: body, headers: headers)
|
22
|
-
end
|
23
|
-
|
24
|
-
def default_body
|
25
|
-
TemplateRenderer.new(context).render(action_name.underscore)
|
26
|
-
end
|
27
|
-
|
28
|
-
def default_headers
|
29
|
-
DEFAULT_HTTP_HEADERS.merge('SOAPAction' => action_name)
|
30
|
-
end
|
31
|
-
|
32
|
-
def action_name
|
33
|
-
class_name.sub(/Request$/, '')
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
module Soap
|
4
|
-
module Request
|
5
|
-
class DownloadCampaignsByAccountIdsRequest < Base
|
6
|
-
API_BASE_URL = 'https://bulk.api.bingads.microsoft.com'
|
7
|
-
API_VERSION = 10
|
8
|
-
API_ENDPOINT =
|
9
|
-
"#{API_BASE_URL}/Api/Advertiser/CampaignManagement/V#{API_VERSION}/BulkService.svc"
|
10
|
-
|
11
|
-
def perform
|
12
|
-
Response::DownloadCampaignsByAccountIdsResponse.new(post(API_ENDPOINT))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
module Soap
|
4
|
-
module Request
|
5
|
-
class GetAccountsInfoRequest < Base
|
6
|
-
API_BASE_URL = 'https://clientcenter.api.bingads.microsoft.com'
|
7
|
-
API_VERSION = 9
|
8
|
-
API_ENDPOINT = "#{API_BASE_URL}/Api/CustomerManagement/" \
|
9
|
-
"v#{API_VERSION}/CustomerManagementService.svc"
|
10
|
-
|
11
|
-
def perform
|
12
|
-
Response::GetAccountsInfoResponse.new(post(API_ENDPOINT))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
module Soap
|
4
|
-
module Request
|
5
|
-
class GetAdGroupsByCampaignIdRequest < Base
|
6
|
-
API_BASE_URL = 'https://campaign.api.bingads.microsoft.com'
|
7
|
-
API_VERSION = 10
|
8
|
-
API_ENDPOINT = "#{API_BASE_URL}/Api/Advertiser/CampaignManagement/" \
|
9
|
-
"V#{API_VERSION}/CampaignManagementService.svc"
|
10
|
-
|
11
|
-
def perform
|
12
|
-
Response::GetAdGroupsByCampaignIdResponse.new(post(API_ENDPOINT))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
module Soap
|
4
|
-
module Request
|
5
|
-
class GetAdsByAdGroupIdRequest < Base
|
6
|
-
API_BASE_URL = 'https://campaign.api.bingads.microsoft.com'
|
7
|
-
API_VERSION = 10
|
8
|
-
API_ENDPOINT = "#{API_BASE_URL}/Api/Advertiser/CampaignManagement/" \
|
9
|
-
"V#{API_VERSION}/CampaignManagementService.svc"
|
10
|
-
|
11
|
-
def perform
|
12
|
-
Response::GetAdsByAdGroupIdResponse.new(post(API_ENDPOINT))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
module Soap
|
4
|
-
module Request
|
5
|
-
class GetBulkDownloadStatusRequest < Base
|
6
|
-
API_BASE_URL = 'https://bulk.api.bingads.microsoft.com'
|
7
|
-
API_VERSION = 10
|
8
|
-
API_ENDPOINT =
|
9
|
-
"#{API_BASE_URL}/Api/Advertiser/CampaignManagement/V#{API_VERSION}/BulkService.svc"
|
10
|
-
|
11
|
-
def perform
|
12
|
-
Response::GetBulkDownloadStatusResponse.new(post(API_ENDPOINT))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module SoapyBing
|
3
|
-
module Soap
|
4
|
-
module Request
|
5
|
-
class GetTargetsByCampaignIdsRequest < Base
|
6
|
-
API_BASE_URL = 'https://campaign.api.bingads.microsoft.com'
|
7
|
-
API_VERSION = 10
|
8
|
-
API_ENDPOINT = "#{API_BASE_URL}/Api/Advertiser/CampaignManagement/" \
|
9
|
-
"V#{API_VERSION}/CampaignManagementService.svc"
|
10
|
-
|
11
|
-
def perform
|
12
|
-
Response::GetTargetsByCampaignIdsResponse.new(post(API_ENDPOINT))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|