blurb 0.2.0 → 0.2.1

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: 63a760f4bc9527d16c8807493e9c18fb0119b32e
4
- data.tar.gz: 0a9ac5d8323d027edbc2f0955309408c081598c1
3
+ metadata.gz: 004d2d0b9c693746aeaee5a50ab9162b261a1582
4
+ data.tar.gz: 27edfbdf34bbf555ce2dd92f3810e4a4733aa06a
5
5
  SHA512:
6
- metadata.gz: 91605250485ba4b8f3b7916b223ba897eb5867df87b81d49fc798f2db157ac458e33985c73dece02b5db505a27715beba4df24e450a7147bc2b92275837abdf1
7
- data.tar.gz: e5d06e3a7bdf21e35e77b44bccede935db2071552a1aea90bb6e0880944945eb63fc66835b38b8d77acc1e6e6c9818ade1c69b363b8cf08f6f317aaee833d8a7
6
+ metadata.gz: 744fb19e8af5a98530c37f35da86931b2ee976d09dc838ca3101de0fba695a8b8e2e5b0801a610871b0057061dfee686ba583cbf499c75368b0f3edc9570e3c5
7
+ data.tar.gz: 7c8495be4e7ec9251d90f3528c74e8e33e84ec08907314c89fa929e18569228bc316ba146e8c8ddf17b0faf09db4b6a2b02de96d455460814cd67324cdcb8d4c
data/README.md CHANGED
@@ -150,12 +150,22 @@ List campaigns
150
150
  ```ruby
151
151
  Blurb::Campaign.list(campaign_type)
152
152
  ```
153
+ or
154
+ ```ruby
155
+ Blurb::Campaign.list_extended(campaign_type)
156
+ ```
157
+ Note that the extended call returns the complete set of campaign fields (including serving status and other read-only fields), but is less efficient.
153
158
 
154
159
  Get a campaign
155
160
 
156
161
  ```ruby
157
162
  Blurb::Campaign.retrieve(campaign_id, campaign_type)
158
163
  ```
164
+ or
165
+ ```ruby
166
+ Blurb::Campaign.retrieve_extended(campaign_id, campaign_type)
167
+ ```
168
+ Note that the extended call returns the complete set of campaign fields (including serving status and other read-only fields), but is less efficient.
159
169
 
160
170
  Create a campaign
161
171
 
@@ -48,7 +48,7 @@ module Blurb
48
48
 
49
49
  request_config = {
50
50
  method: :post,
51
- url: "#{Blurb::API_URL}#{api_path}",
51
+ url: "#{Blurb.active_api_url}#{api_path}",
52
52
  payload: payload.to_json,
53
53
  headers: {
54
54
  "Authorization" => "Bearer #{access_token['access_token']}",
@@ -8,6 +8,7 @@ module Blurb
8
8
  end
9
9
 
10
10
  def self.retrieve_extended(campaign_id, campaign_type)
11
+ raise ArgumentError.new("Extended campaigns interface is only supported for Sponsored Products") unless campaign_type == SPONSORED_PRODUCTS
11
12
  get_request("/v2/#{campaign_type}/campaigns/extended/#{campaign_id}")
12
13
  end
13
14
 
@@ -15,12 +16,17 @@ module Blurb
15
16
  get_request("/v2/#{campaign_type}/campaigns?#{setup_url_params(params)}")
16
17
  end
17
18
 
19
+ def self.list_extended(campaign_type, params = {}, opts = {})
20
+ raise ArgumentError.new("Extended campaigns interface is only supported for Sponsored Products") unless campaign_type == SPONSORED_PRODUCTS
21
+ get_request("/v2/#{campaign_type}/campaigns/extended?#{setup_url_params(params)}")
22
+ end
23
+
18
24
  def self.create(campaign_type, params = {}, opts = {})
19
25
  # required argument checks
20
26
  if !params["name"] && !params["targetingType"] && !params["state"] && !params["dailyBudget"] && !params["startDate"]
21
27
  raise ArgumentError.new("params hash must contain name, targetingType, state, dailyBudget and startDate")
22
28
  end
23
- raise ArgumentError.new("Only sponsored product campaigns can be created through the api. Sponsored Brands campaigns must be created through the user interface") unless campaign_type = SPONSORED_PRODUCTS
29
+ raise ArgumentError.new("Only sponsored product campaigns can be created through the api. Sponsored Brands campaigns must be created through the user interface") unless campaign_type == SPONSORED_PRODUCTS
24
30
 
25
31
  post_request("/v2/#{campaign_type}/campaigns", [params])
26
32
  end
@@ -1,3 +1,3 @@
1
1
  module Blurb
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blurb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - dlbunker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2018-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.6.13
147
+ rubygems_version: 2.6.14
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Ruby gem for the Amazon Advertising API