yahoo_gemini_client 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5b1e3fca354aabc79f6990c1d7abfbfdea37029
4
- data.tar.gz: 702dd7ac7c78496645e7668e9aaebca9e9b11b44
3
+ metadata.gz: 73b01b979a482ac94e77e93c118b2c153eb76181
4
+ data.tar.gz: 0e71443f1da5067f199513a96b7f9610f7087c61
5
5
  SHA512:
6
- metadata.gz: 637204a3990b4c84b5a6df694dc587475168a686a440d42ff2b7dc4bbd6a147cff804b29af6688fcd77c8e273389534a22e1ddd24387c5ae8cd5bcf20dd0e7cd
7
- data.tar.gz: bfb3a69a3e8650fe7c7c7f42b5b1fdcf1b50a363718adf422b2a26dad11da1c973fcc54a60d0928a66cba0686fecd53968a6b4fc2e9b6469f442afe7d53e1c83
6
+ metadata.gz: f83ad012a665646751adbdabb27ef4adc2a45a3386dba9a3a2f1ef9535470016a6c62e30cfb2de4e1da7681212e69d9b0ed18f3e5b3d2e711643bcfbf626de21
7
+ data.tar.gz: 9ac1ffa959f1844231db00ce9eb6c56db05e62b48c51f8802cfdfaa8cfe257262fde3897633447324565b7972219f4078acadd3fcd9c49405dbf42eaa915d2bc
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
  /tmp/
10
10
  spec/config.yml
11
11
  .env.override
12
+ .idea
@@ -1,12 +1,25 @@
1
- # 0.1.1
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
2
3
 
3
- - Make initialization follow what README states (no need to wrap `refresh_token` in a hash)
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## [0.2.0] - 2016-09-02
8
+ ### Added
9
+ - Add Advertisers.all
4
10
 
5
- # 0.1.0
11
+ ### Changed
12
+ - Use v2 API
6
13
 
14
+ ## [0.1.1]
15
+ ### Fixed
16
+ - Make initialization follow what README states (no need to wrap `refresh_token` in a hash)
17
+
18
+ ## [0.1.0]
19
+ ### Added
7
20
  - Add custom reports
8
21
  - Refactor advertisers
9
22
 
10
- # 0.0.1
11
-
23
+ ## [0.0.1]
24
+ ### Added
12
25
  - Initial release
data/README.md CHANGED
@@ -55,6 +55,10 @@ client = YahooGeminiClient::Client.new(
55
55
  response = client.advertisers.find(123)
56
56
  response.error? # check if response is error
57
57
  response.advertiser # returns a YahooGeminiClient::Advertiser
58
+
59
+ response = client.advertisers.all
60
+ response.error? # check if response is error
61
+ response.advertisers # returns an array containing YahooGeminiClient::Advertiser
58
62
  ```
59
63
 
60
64
  ### Custom Reports
@@ -14,6 +14,7 @@ require "yahoo_gemini_client/models/ad_group"
14
14
  require "yahoo_gemini_client/services/ad_groups"
15
15
  require "yahoo_gemini_client/responses/base_response"
16
16
  require "yahoo_gemini_client/responses/advertiser_response"
17
+ require "yahoo_gemini_client/responses/advertisers_response"
17
18
  require "yahoo_gemini_client/requests/base_request"
18
19
  require "yahoo_gemini_client/requests/custom_report_base_request"
19
20
  require "yahoo_gemini_client/requests/custom_report_job_request"
@@ -22,6 +23,7 @@ require "yahoo_gemini_client/requests/campaign_base_request"
22
23
  require "yahoo_gemini_client/requests/campaign_fetch_request"
23
24
  require "yahoo_gemini_client/requests/advertiser_base_request"
24
25
  require "yahoo_gemini_client/requests/advertiser_fetch_request"
26
+ require "yahoo_gemini_client/requests/advertisers_fetch_request"
25
27
  require "yahoo_gemini_client/requests/ad_group_base_request"
26
28
  require "yahoo_gemini_client/requests/ad_group_fetch_request"
27
29
  require "yahoo_gemini_client/responses/custom_report_response"
@@ -1,6 +1,6 @@
1
1
  module YahooGeminiClient
2
2
  class AdGroupBaseRequest < BaseRequest
3
- REQUEST_URI = "https://api.admanager.yahoo.com/v1/rest/adgroup"
3
+ REQUEST_URI = "https://api.admanager.yahoo.com/v2/rest/adgroup"
4
4
  include Virtus.model
5
5
 
6
6
  def http_authorization_header
@@ -1,6 +1,6 @@
1
1
  module YahooGeminiClient
2
2
  class AdvertiserBaseRequest < BaseRequest
3
- REQUEST_URI = "https://api.admanager.yahoo.com/v1/rest/advertiser"
3
+ REQUEST_URI = "https://api.admanager.yahoo.com/v2/rest/advertiser"
4
4
  include Virtus.model
5
5
 
6
6
  def http_authorization_header
@@ -0,0 +1,16 @@
1
+ module YahooGeminiClient
2
+ class AdvertisersFetchRequest < AdvertiserBaseRequest
3
+
4
+ def execute
5
+ response = get(request_uri: build_request_uri)
6
+ AdvertisersResponse.new(response.with_indifferent_access)
7
+ end
8
+
9
+ private
10
+
11
+ def build_request_uri
12
+ REQUEST_URI
13
+ end
14
+
15
+ end
16
+ end
@@ -1,6 +1,6 @@
1
1
  module YahooGeminiClient
2
2
  class CampaignBaseRequest < BaseRequest
3
- REQUEST_URI = "https://api.admanager.yahoo.com/v1/rest/campaign"
3
+ REQUEST_URI = "https://api.admanager.yahoo.com/v2/rest/campaign"
4
4
  include Virtus.model
5
5
 
6
6
  def http_authorization_header
@@ -1,6 +1,6 @@
1
1
  module YahooGeminiClient
2
2
  class CustomReportBaseRequest < BaseRequest
3
- REQUEST_URI = "https://api.admanager.yahoo.com/v1/rest/reports/custom"
3
+ REQUEST_URI = "https://api.admanager.yahoo.com/v2/rest/reports/custom"
4
4
  include Virtus.model
5
5
 
6
6
  def http_authorization_header
@@ -0,0 +1,13 @@
1
+ module YahooGeminiClient
2
+ class AdvertisersResponse < BaseResponse
3
+ attr_accessor :errors, :timestamp, :advertisers
4
+
5
+ def initialize(json_response)
6
+ @errors = json_response[:errors]
7
+ @timestamp = json_response[:timestamp]
8
+ @advertisers = json_response[:response].map do |advertiser_hash|
9
+ Advertiser.new(advertiser_hash)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -8,5 +8,9 @@ module YahooGeminiClient
8
8
  params = { advertiser_id: advertiser_id }
9
9
  AdvertiserFetchRequest.new(params.merge(client: @client)).execute
10
10
  end
11
+
12
+ def all
13
+ AdvertisersFetchRequest.new(client: @client).execute
14
+ end
11
15
  end
12
16
  end
@@ -1,3 +1,3 @@
1
1
  module YahooGeminiClient
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yahoo_gemini_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-08-18 00:00:00.000000000 Z
12
+ date: 2016-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2
@@ -239,6 +239,7 @@ files:
239
239
  - lib/yahoo_gemini_client/requests/ad_group_fetch_request.rb
240
240
  - lib/yahoo_gemini_client/requests/advertiser_base_request.rb
241
241
  - lib/yahoo_gemini_client/requests/advertiser_fetch_request.rb
242
+ - lib/yahoo_gemini_client/requests/advertisers_fetch_request.rb
242
243
  - lib/yahoo_gemini_client/requests/base_request.rb
243
244
  - lib/yahoo_gemini_client/requests/campaign_base_request.rb
244
245
  - lib/yahoo_gemini_client/requests/campaign_fetch_request.rb
@@ -247,6 +248,7 @@ files:
247
248
  - lib/yahoo_gemini_client/requests/custom_report_job_request.rb
248
249
  - lib/yahoo_gemini_client/responses/ad_group_response.rb
249
250
  - lib/yahoo_gemini_client/responses/advertiser_response.rb
251
+ - lib/yahoo_gemini_client/responses/advertisers_response.rb
250
252
  - lib/yahoo_gemini_client/responses/base_response.rb
251
253
  - lib/yahoo_gemini_client/responses/campaign_response.rb
252
254
  - lib/yahoo_gemini_client/responses/custom_report_response.rb
@@ -277,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
279
  version: '0'
278
280
  requirements: []
279
281
  rubyforge_project:
280
- rubygems_version: 2.4.6
282
+ rubygems_version: 2.5.1
281
283
  signing_key:
282
284
  specification_version: 4
283
285
  summary: A Ruby Interface to the Yahoo Gemini API