Skip to content

Commit

Permalink
Merge pull request #40 from forward3d/version6
Browse files Browse the repository at this point in the history
Version 6.0.0
  • Loading branch information
Babak Gh authored Aug 24, 2020
2 parents 8c29000 + 929bd16 commit a60a141
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 353 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* 6.0.0
Remove curb in favor of httparty
BREAKING CHANGE: Remove InsightService

* 5.0.0
Fully using API V13
BREAKING CHANGE: AdInsightService class removed, use ReportingService instead
Expand Down
80 changes: 1 addition & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,72 +31,9 @@ service = BingAdsReporting::BulkService.new({
})
```

#### Insight Service(actual AdInsight Serive) - [Bing Ads API reference for Bulk Service](https://docs.microsoft.com/en-us/advertising/ad-insight-service/ad-insight-service-reference?view=bingads-13)

```ruby
service = BingAdsReporting::InsightService.new(auth_settings, logger, request_class)
```

##### Request Class example

For which report in AdInsightService API, which one has different SOAP request.

Bellow an example of the request for [Auction Insight report](https://docs.microsoft.com/en-us/advertising/ad-insight-service/getauctioninsightdata?view=bingads-13#request-soap).

```ruby
class AuctionInsightRequest
attr_reader :period, :options

def initialize(period, options)
@period = period
@options = options
end

def self.message(period, options)
new(period, options).message
end

def message
{
'EntityType' => options[:entity_type],
'SearchParameters' => {
'SearchParameter' => {
'EndDate' => {
'Day' => '10',
'Month' => '02',
'Year' => '2018'
},
'StartDate' => {
'Day' => '10',
'Month' => '01',
'Year' => '2018'
},
'@i:type' => 'tns:DateRangeSearchParameter'
}
},
'@xsi:type' => 'tns:DateRangeSearchParameter'
}
end
end
```

#### AdInsight Service(DEPRECATED)

Use `ReportingService` instead.

```ruby
service = BingAdsReporting::AdInsightService.new({
developerToken: '',
applicationToken: '',
authenticationToken: '',
:accountId: '',
customerId: ''
})
```

## Create report and get it's ID

### Ad Reporting Service
### Reporting Service

```ruby
period = Datebox::Period.new('2013-07-01', '2013-07-03')
Expand All @@ -117,7 +54,6 @@ id = service.generate_report({report_type: 'DownloadCampaignsByAccountIds'
download_entities: ['Keywords']},
{})
```

### Get Report

Get report URL for download by report ID if it's ready
Expand All @@ -131,17 +67,3 @@ or get its content by ID (also once ready)
```ruby
service.report_body(id) if service.report_ready?(id)
```

## InsightService

### Get Auction Insight Results

```ruby
result = service.generate_report({report_type: AuctionInsightData, entity_type: 'Account'})
```

### Get Auction Insight Results for Keywords

```ruby
result = service.generate_report({report_type: AuctionInsightData, entity_type: 'Account', entity_ids: [1, 2, 3]})
```
8 changes: 4 additions & 4 deletions bing-ads-reporting.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Gem::Specification.new do |gem|
gem.test_files = [] # gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ['lib']

gem.add_dependency 'curb', '~> 0.9.10'
gem.add_dependency 'datebox', '~> 0.5.0'
gem.add_dependency 'oauth2', '~> 1.4.1'
gem.add_dependency 'savon', '~> 2.12.0'
gem.add_dependency 'httparty', '~> 0.17.0'
gem.add_dependency 'datebox', '~> 0.5.0'
gem.add_dependency 'oauth2', '~> 1.4.1'
gem.add_dependency 'savon', '~> 2.12.0'

gem.add_development_dependency 'reek', '~> 5.4.0'
gem.add_development_dependency 'rspec', '~> 3.4.0'
Expand Down
10 changes: 2 additions & 8 deletions lib/bing-ads-reporting/downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,8 @@ def self.fetch_report(report_url)

def fetch_report
logger.debug "Downloading Bing report from: #{report_url}"
curl.perform
curl.body_str
end

private

def curl
@curl ||= Curl::Easy.new(report_url)
response = HTTParty.get(report_url)
response.body
end
end
end
56 changes: 0 additions & 56 deletions lib/bing-ads-reporting/insight_service.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/bing-ads-reporting/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BingAdsReporting
VERSION = '5.0.0'.freeze
VERSION = '6.0.0'.freeze
end
1 change: 0 additions & 1 deletion lib/bing_ads_reporting.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require_relative 'bing-ads-reporting/bing_helper'
require_relative 'bing-ads-reporting/bing_settings'
require_relative 'bing-ads-reporting/soap_error_helper'
require_relative 'bing-ads-reporting/insight_service'
require_relative 'bing-ads-reporting/bulk_service'
require_relative 'bing-ads-reporting/reporting_service'
require_relative 'bing-ads-reporting/version'
Expand Down
Loading

0 comments on commit a60a141

Please sign in to comment.