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 +4 -4
- data/README.md +10 -0
- data/lib/blurb/base_resource.rb +1 -1
- data/lib/blurb/campaign.rb +7 -1
- data/lib/blurb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 004d2d0b9c693746aeaee5a50ab9162b261a1582
|
4
|
+
data.tar.gz: 27edfbdf34bbf555ce2dd92f3810e4a4733aa06a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/blurb/base_resource.rb
CHANGED
data/lib/blurb/campaign.rb
CHANGED
@@ -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
|
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
|
data/lib/blurb/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|