twitter-ads 4.0.1 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/twitter-ads/audiences/tailored_audience.rb +3 -3
- data/lib/twitter-ads/campaign/targeting_criteria.rb +3 -3
- data/lib/twitter-ads/client.rb +1 -1
- data/lib/twitter-ads/creative/cards_fetch.rb +15 -15
- data/lib/twitter-ads/creative/image_app_download_card.rb +0 -1
- data/lib/twitter-ads/creative/image_conversation_card.rb +0 -1
- data/lib/twitter-ads/creative/poll_cards.rb +0 -1
- data/lib/twitter-ads/creative/video_app_download_card.rb +0 -1
- data/lib/twitter-ads/creative/video_conversation_card.rb +0 -1
- data/lib/twitter-ads/creative/video_website_card.rb +0 -1
- data/lib/twitter-ads/creative/website_card.rb +0 -1
- data/lib/twitter-ads/enum.rb +1 -0
- data/lib/twitter-ads/version.rb +1 -1
- data/spec/twitter-ads/creative/image_app_download_card_spec.rb +1 -1
- data/spec/twitter-ads/creative/image_conversation_card_spec.rb +1 -1
- data/spec/twitter-ads/creative/video_app_download_card_spec.rb +1 -1
- data/spec/twitter-ads/creative/video_conversation_card_spec.rb +0 -1
- data/spec/twitter-ads/creative/website_card_spec.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4483287f7e16d023a370c9352880877081d823a0
|
4
|
+
data.tar.gz: 3a37f0d133d886db3e41766b52f3364123e210d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 898ecdf5405dbb342ddf5b40d77904d854cdf9f0e284144142bcdcb594dbd4c01d7a0ed324c9f71bfcc3d6a6b55b73121076a2815314037d3f0a9c0464da57d0
|
7
|
+
data.tar.gz: 4a22e9b421c345b52e476a6d528454a3b790b46b462fa0017a389efbe36e45ec81cc30004cb8336af34158216d6d5f1a76b73fc76e10455ffef3773aad9c72fd
|
@@ -33,9 +33,9 @@ module TwitterAds
|
|
33
33
|
'accounts/%{account_id}/tailored_audience_changes'.freeze # @api private
|
34
34
|
RESOURCE_MEMBERSHIPS = "/#{TwitterAds::API_VERSION}/" +
|
35
35
|
'tailored_audience_memberships'.freeze # @api private
|
36
|
-
RESOURCE_USERS = "/#{TwitterAds::API_VERSION}/
|
37
|
-
accounts/%{account_id}/tailored_audiences/
|
38
|
-
%{id}/users
|
36
|
+
RESOURCE_USERS = "/#{TwitterAds::API_VERSION}/" +
|
37
|
+
'accounts/%{account_id}/tailored_audiences/' +
|
38
|
+
'%{id}/users'.freeze # @api private
|
39
39
|
# @api private
|
40
40
|
GLOBAL_OPT_OUT = "/#{TwitterAds::API_VERSION}/" +
|
41
41
|
'accounts/%{account_id}/tailored_audiences/global_opt_out'.freeze
|
@@ -45,7 +45,7 @@ module TwitterAds
|
|
45
45
|
# Returns a Cursor instance for a given resource.
|
46
46
|
#
|
47
47
|
# @param account [Account] The Account object instance.
|
48
|
-
# @param
|
48
|
+
# @param line_item_ids [String] A String or String array of Line Item IDs.
|
49
49
|
# @param opts [Hash] An optional Hash of extended options.
|
50
50
|
# @option opts [Boolean] :with_deleted Indicates if deleted items should be included.
|
51
51
|
# @option opts [String] :sort_by The object param to sort the API response by.
|
@@ -55,8 +55,8 @@ module TwitterAds
|
|
55
55
|
# @since 0.3.1
|
56
56
|
# @see Cursor
|
57
57
|
# @see https://dev.twitter.com/ads/basics/sorting Sorting
|
58
|
-
def all(account,
|
59
|
-
params = {
|
58
|
+
def all(account, line_item_ids, opts = {})
|
59
|
+
params = { line_item_ids: Array(line_item_ids).join(',') }.merge!(opts)
|
60
60
|
resource = RESOURCE_COLLECTION % { account_id: account.id }
|
61
61
|
request = Request.new(account.client, :get, resource, params: params)
|
62
62
|
Cursor.new(self, request, init_with: [account])
|
data/lib/twitter-ads/client.rb
CHANGED
@@ -40,7 +40,6 @@ module TwitterAds
|
|
40
40
|
property :iphone_app_id, read_only: true
|
41
41
|
property :iphone_deep_link, read_only: true
|
42
42
|
property :name, read_only: true
|
43
|
-
property :preview_url, read_only: true
|
44
43
|
property :recipient_user_id, read_only: true
|
45
44
|
property :second_choice, read_only: true
|
46
45
|
property :second_cta, read_only: true
|
@@ -73,7 +72,7 @@ module TwitterAds
|
|
73
72
|
property :id, read_only: true
|
74
73
|
|
75
74
|
FETCH_URI = "/#{TwitterAds::API_VERSION}/" +
|
76
|
-
'accounts/%{account_id}/cards'.freeze # @api private
|
75
|
+
'accounts/%{account_id}/cards/all'.freeze # @api private
|
77
76
|
FETCH_ID = "/#{TwitterAds::API_VERSION}/" +
|
78
77
|
'accounts/%{account_id}/cards/all/%{id}'.freeze # @api private
|
79
78
|
|
@@ -82,26 +81,27 @@ module TwitterAds
|
|
82
81
|
"'CardsFetch' object has no attribute 'all'")
|
83
82
|
end
|
84
83
|
|
85
|
-
def load(account,
|
86
|
-
if (
|
87
|
-
raise ArgumentError.new('
|
84
|
+
def load(account, card_uris = nil, card_id = nil, with_deleted = nil, opts = {})
|
85
|
+
if (card_uris && card_id) || (card_uris.nil? && card_id.nil?)
|
86
|
+
raise ArgumentError.new('card_uris and card_id are exclusive parameters. ' \
|
88
87
|
'Please supply one or the other, but not both.')
|
89
88
|
end
|
90
89
|
|
91
|
-
if card_uri
|
92
|
-
params = { card_uri: card_uri }.merge!(opts)
|
93
|
-
resource = FETCH_URI % { account_id: account.id }
|
94
|
-
else
|
95
|
-
params = { card_id: card_id }.merge!(opts)
|
96
|
-
resource = FETCH_ID % { account_id: account.id, id: card_id }
|
97
|
-
end
|
98
|
-
|
99
90
|
if with_deleted && TwitterAds::Utils.to_bool(with_deleted)
|
100
91
|
params = { with_deleted: true }.merge!(opts)
|
101
92
|
end
|
102
93
|
|
103
|
-
|
104
|
-
|
94
|
+
if card_uris
|
95
|
+
params = { card_uris: Array(card_uris).join(',') }.merge!(opts).merge!(params)
|
96
|
+
resource = FETCH_URI % { account_id: account.id }
|
97
|
+
request = Request.new(account.client, :get, resource, params: params)
|
98
|
+
return Cursor.new(self.class, request, init_with: [account])
|
99
|
+
else
|
100
|
+
params = { card_id: card_id }.merge!(opts).merge!(params)
|
101
|
+
resource = FETCH_ID % { account_id: account.id, id: card_id }
|
102
|
+
response = Request.new(account.client, :get, resource, params: params).perform
|
103
|
+
return from_response(response.body[:data])
|
104
|
+
end
|
105
105
|
end
|
106
106
|
|
107
107
|
def reload!
|
@@ -19,7 +19,6 @@ module TwitterAds
|
|
19
19
|
property :id, read_only: true
|
20
20
|
property :image_display_height, read_only: true
|
21
21
|
property :image_display_width, read_only: true
|
22
|
-
property :preview_url, read_only: true
|
23
22
|
property :updated_at, type: :time, read_only: true
|
24
23
|
property :wide_app_image, read_only: true
|
25
24
|
|
@@ -18,7 +18,6 @@ module TwitterAds
|
|
18
18
|
property :deleted, type: :bool, read_only: true
|
19
19
|
property :id, read_only: true
|
20
20
|
property :image, read_only: true
|
21
|
-
property :preview_url, read_only: true
|
22
21
|
property :updated_at, type: :time, read_only: true
|
23
22
|
|
24
23
|
property :cover_image_id
|
@@ -22,7 +22,6 @@ module TwitterAds
|
|
22
22
|
property :image, read_only: true
|
23
23
|
property :image_display_height, read_only: true
|
24
24
|
property :image_display_width, read_only: true
|
25
|
-
property :preview_url, read_only: true
|
26
25
|
property :start_time, type: :time, read_only: true
|
27
26
|
property :updated_at, type: :time, read_only: true
|
28
27
|
property :video_height, read_only: true
|
@@ -17,7 +17,6 @@ module TwitterAds
|
|
17
17
|
property :created_at, type: :time, read_only: true
|
18
18
|
property :deleted, type: :bool, read_only: true
|
19
19
|
property :id, read_only: true
|
20
|
-
property :preview_url, read_only: true
|
21
20
|
property :updated_at, type: :time, read_only: true
|
22
21
|
property :video_content_id, read_only: true
|
23
22
|
property :video_hls_url, read_only: true
|
@@ -17,7 +17,6 @@ module TwitterAds
|
|
17
17
|
property :created_at, type: :time, read_only: true
|
18
18
|
property :deleted, type: :bool, read_only: true
|
19
19
|
property :id, read_only: true
|
20
|
-
property :preview_url, read_only: true
|
21
20
|
property :updated_at, type: :time, read_only: true
|
22
21
|
property :video_url, read_only: true
|
23
22
|
property :video_poster_url, read_only: true
|
@@ -18,7 +18,6 @@ module TwitterAds
|
|
18
18
|
property :created_at, type: :time, read_only: true
|
19
19
|
property :deleted, type: :bool, read_only: true
|
20
20
|
property :id, read_only: true
|
21
|
-
property :preview_url, read_only: true
|
22
21
|
property :updated_at, type: :time, read_only: true
|
23
22
|
property :video_content_id, read_only: true
|
24
23
|
property :video_height, read_only: true
|
@@ -20,7 +20,6 @@ module TwitterAds
|
|
20
20
|
property :image, read_only: true
|
21
21
|
property :image_display_height, read_only: true
|
22
22
|
property :image_display_width, read_only: true
|
23
|
-
property :preview_url, read_only: true
|
24
23
|
property :updated_at, type: :time, read_only: true
|
25
24
|
property :website_dest_url, read_only: true
|
26
25
|
property :website_display_url, read_only: true
|
data/lib/twitter-ads/enum.rb
CHANGED
data/lib/twitter-ads/version.rb
CHANGED
@@ -23,7 +23,7 @@ describe TwitterAds::Creative::ImageAppDownloadCard do
|
|
23
23
|
|
24
24
|
# check model properties
|
25
25
|
subject { described_class.new(account) }
|
26
|
-
read = %w(id
|
26
|
+
read = %w(id created_at updated_at deleted)
|
27
27
|
|
28
28
|
write = %w(
|
29
29
|
name
|
@@ -23,7 +23,7 @@ describe TwitterAds::Creative::ImageConversationCard do
|
|
23
23
|
|
24
24
|
# check model properties
|
25
25
|
subject { described_class.new(account) }
|
26
|
-
read = %w(id
|
26
|
+
read = %w(id image deleted created_at updated_at)
|
27
27
|
write = %w(
|
28
28
|
name
|
29
29
|
title
|
@@ -23,7 +23,7 @@ describe TwitterAds::Creative::VideoAppDownloadCard do
|
|
23
23
|
|
24
24
|
# check model properties
|
25
25
|
subject { described_class.new(account) }
|
26
|
-
read = %w(id
|
26
|
+
read = %w(id video_url video_poster_url deleted created_at updated_at)
|
27
27
|
write = %w(
|
28
28
|
name
|
29
29
|
country_code
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter-ads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Black
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-03-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: multi_json
|