twitter-ads 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/README.md +3 -4
- data/Rakefile +1 -2
- data/lib/twitter-ads.rb +10 -11
- data/lib/twitter-ads/account.rb +12 -12
- data/lib/twitter-ads/audiences/audience_intelligence.rb +3 -3
- data/lib/twitter-ads/audiences/tailored_audience.rb +12 -156
- data/lib/twitter-ads/campaign/app_list.rb +5 -5
- data/lib/twitter-ads/campaign/campaign.rb +7 -11
- data/lib/twitter-ads/campaign/funding_instrument.rb +6 -5
- data/lib/twitter-ads/campaign/iab_category.rb +2 -2
- data/lib/twitter-ads/campaign/line_item.rb +18 -21
- data/lib/twitter-ads/campaign/organic_tweet.rb +1 -5
- data/lib/twitter-ads/campaign/promotable_user.rb +5 -5
- data/lib/twitter-ads/campaign/targeting_criteria.rb +7 -7
- data/lib/twitter-ads/campaign/tweet.rb +7 -11
- data/lib/twitter-ads/client.rb +3 -4
- data/lib/twitter-ads/creative/account_media.rb +5 -5
- data/lib/twitter-ads/creative/cards_fetch.rb +8 -6
- data/lib/twitter-ads/creative/image_app_download_card.rb +5 -5
- data/lib/twitter-ads/creative/image_conversation_card.rb +5 -5
- data/lib/twitter-ads/creative/media_creative.rb +6 -5
- data/lib/twitter-ads/creative/media_library.rb +5 -5
- data/lib/twitter-ads/creative/poll_cards.rb +5 -5
- data/lib/twitter-ads/creative/promoted_account.rb +5 -9
- data/lib/twitter-ads/creative/promoted_tweet.rb +5 -9
- data/lib/twitter-ads/creative/scheduled_tweet.rb +7 -7
- data/lib/twitter-ads/creative/tweet_previews.rb +36 -0
- data/lib/twitter-ads/creative/video_app_download_card.rb +5 -5
- data/lib/twitter-ads/creative/video_conversation_card.rb +5 -5
- data/lib/twitter-ads/creative/video_website_card.rb +4 -4
- data/lib/twitter-ads/creative/website_card.rb +3 -3
- data/lib/twitter-ads/cursor.rb +2 -2
- data/lib/twitter-ads/enum.rb +128 -122
- data/lib/twitter-ads/error.rb +2 -2
- data/lib/twitter-ads/http/request.rb +6 -5
- data/lib/twitter-ads/http/response.rb +1 -1
- data/lib/twitter-ads/legacy.rb +1 -1
- data/lib/twitter-ads/measurement/app_event_tag.rb +3 -3
- data/lib/twitter-ads/measurement/web_event_tag.rb +3 -3
- data/lib/twitter-ads/resources/analytics.rb +38 -8
- data/lib/twitter-ads/resources/batch.rb +4 -4
- data/lib/twitter-ads/resources/dsl.rb +1 -1
- data/lib/twitter-ads/resources/persistence.rb +1 -1
- data/lib/twitter-ads/resources/resource.rb +2 -2
- data/lib/twitter-ads/settings/tax.rb +3 -3
- data/lib/twitter-ads/settings/user.rb +3 -3
- data/lib/twitter-ads/targeting/reach_estimate.rb +1 -1
- data/lib/twitter-ads/targeting_criteria/app_store_category.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/behavior.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/behavior_taxonomy.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/device.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/event.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/interest.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/language.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/location.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/network_operator.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/platform.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/platform_version.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/tv_market.rb +3 -3
- data/lib/twitter-ads/targeting_criteria/tv_show.rb +3 -3
- data/lib/twitter-ads/utils.rb +2 -2
- data/lib/twitter-ads/version.rb +2 -2
- data/spec/quality_spec.rb +2 -2
- data/spec/shared/properties.rb +1 -1
- data/spec/spec_helper.rb +9 -8
- data/spec/support/helpers.rb +1 -1
- data/spec/twitter-ads/account_spec.rb +1 -1
- data/spec/twitter-ads/audiences/tailored_audience_spec.rb +1 -1
- data/spec/twitter-ads/campaign/app_list_spec.rb +1 -1
- data/spec/twitter-ads/campaign/line_item_spec.rb +1 -1
- data/spec/twitter-ads/campaign/reach_estimate_spec.rb +1 -1
- data/spec/twitter-ads/campaign/targeting_criteria_spec.rb +1 -1
- data/spec/twitter-ads/campaign/tweet_spec.rb +1 -1
- data/spec/twitter-ads/client_spec.rb +1 -1
- data/spec/twitter-ads/creative/account_media_spec.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/media_creative_spec.rb +1 -1
- data/spec/twitter-ads/creative/promoted_account_spec.rb +1 -1
- data/spec/twitter-ads/creative/promoted_tweet_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 +1 -1
- data/spec/twitter-ads/creative/website_card_spec.rb +1 -1
- data/spec/twitter-ads/cursor_spec.rb +1 -1
- data/spec/twitter-ads/placements_spec.rb +1 -1
- data/spec/twitter-ads/utils_spec.rb +1 -1
- data/twitter-ads.gemspec +10 -6
- metadata +10 -25
- data/lib/twitter-ads/http/ton_upload.rb +0 -156
- data/spec/twitter-ads/http/ton_upload_spec.rb +0 -96
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
class FundingInstrument
|
6
6
|
|
7
7
|
include TwitterAds::DSL
|
8
8
|
include TwitterAds::Resource
|
9
|
+
include TwitterAds::Analytics
|
9
10
|
|
10
11
|
attr_reader :account
|
11
12
|
|
@@ -24,10 +25,10 @@ module TwitterAds
|
|
24
25
|
property :io_header, read_only: true
|
25
26
|
property :reasons_not_able_to_fund, read_only: true
|
26
27
|
|
27
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
28
|
-
'accounts/%{account_id}/funding_instruments'
|
29
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
30
|
-
'accounts/%{account_id}/funding_instruments/%{id}'
|
28
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
29
|
+
'accounts/%{account_id}/funding_instruments' # @api private
|
30
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
31
|
+
'accounts/%{account_id}/funding_instruments/%{id}' # @api private
|
31
32
|
|
32
33
|
def initialize(account)
|
33
34
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
class IABCategory
|
@@ -13,7 +13,7 @@ module TwitterAds
|
|
13
13
|
property :name, read_only: true
|
14
14
|
property :parent_id, read_only: true
|
15
15
|
|
16
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/iab_categories"
|
16
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/iab_categories" # @api private
|
17
17
|
|
18
18
|
def initialize(account)
|
19
19
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
class LineItem
|
@@ -17,23 +17,24 @@ module TwitterAds
|
|
17
17
|
property :created_at, type: :time, read_only: true
|
18
18
|
property :updated_at, type: :time, read_only: true
|
19
19
|
|
20
|
-
property :name
|
21
|
-
property :campaign_id
|
22
20
|
property :advertiser_domain
|
21
|
+
property :automatically_select_bid
|
22
|
+
property :bid_amount_local_micro
|
23
|
+
property :bid_unit
|
24
|
+
property :campaign_id
|
23
25
|
property :categories
|
24
26
|
property :charge_by
|
27
|
+
property :end_time, type: :time
|
28
|
+
property :entity_status
|
25
29
|
property :include_sentiment
|
30
|
+
property :name
|
26
31
|
property :objective
|
27
32
|
property :optimization
|
28
|
-
property :
|
33
|
+
property :placements
|
29
34
|
property :primary_web_event_tag
|
30
35
|
property :product_type
|
31
|
-
property :
|
32
|
-
property :bid_unit
|
33
|
-
property :automatically_select_bid
|
34
|
-
property :bid_amount_local_micro
|
36
|
+
property :start_time, type: :time
|
35
37
|
property :total_budget_amount_local_micro
|
36
|
-
property :target_cpa_local_micro
|
37
38
|
|
38
39
|
# beta (not yet generally available)
|
39
40
|
property :advertiser_user_id
|
@@ -44,18 +45,14 @@ module TwitterAds
|
|
44
45
|
# sdk only
|
45
46
|
property :to_delete, type: :bool
|
46
47
|
|
47
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
48
|
-
'accounts/%{account_id}/line_items'
|
49
|
-
|
50
|
-
'
|
51
|
-
|
52
|
-
'
|
53
|
-
|
54
|
-
'
|
55
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
56
|
-
'accounts/%{account_id}/line_items/%{id}'.freeze # @api private
|
57
|
-
RESOURCE_PLACEMENTS = "/#{TwitterAds::API_VERSION}/" +
|
58
|
-
'line_items/placements'.freeze # @api private
|
48
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
49
|
+
'accounts/%{account_id}/line_items' # @api private
|
50
|
+
RESOURCE_BATCH = "/#{TwitterAds::API_VERSION}/" \
|
51
|
+
'batch/accounts/%{account_id}/line_items' # @api private
|
52
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
53
|
+
'accounts/%{account_id}/line_items/%{id}' # @api private
|
54
|
+
RESOURCE_PLACEMENTS = "/#{TwitterAds::API_VERSION}/" \
|
55
|
+
'line_items/placements' # @api private
|
59
56
|
|
60
57
|
def initialize(account)
|
61
58
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
# Author Bob, Nugit
|
4
4
|
|
5
5
|
module TwitterAds
|
@@ -7,9 +7,5 @@ module TwitterAds
|
|
7
7
|
|
8
8
|
include TwitterAds::Analytics
|
9
9
|
|
10
|
-
RESOURCE_STATS = "/#{TwitterAds::API_VERSION}/" +
|
11
|
-
'stats/accounts/%{account_id}'.freeze # @api private
|
12
|
-
RESOURCE_ASYNC_STATS = "/#{TwitterAds::API_VERSION}/" +
|
13
|
-
'stats/jobs/accounts/%{account_id}'.freeze # @api private
|
14
10
|
end
|
15
11
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
class PromotableUser
|
@@ -16,10 +16,10 @@ module TwitterAds
|
|
16
16
|
property :updated_at, type: :time, read_only: true
|
17
17
|
property :deleted, type: :bool, read_only: true
|
18
18
|
|
19
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
20
|
-
'accounts/%{account_id}/promotable_users'
|
21
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
22
|
-
'accounts/%{account_id}/promotable_users/%{id}'
|
19
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
20
|
+
'accounts/%{account_id}/promotable_users' # @api private
|
21
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
22
|
+
'accounts/%{account_id}/promotable_users/%{id}' # @api private
|
23
23
|
|
24
24
|
def initialize(account)
|
25
25
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
class TargetingCriteria
|
@@ -28,12 +28,12 @@ module TwitterAds
|
|
28
28
|
# sdk only
|
29
29
|
property :to_delete, type: :bool
|
30
30
|
|
31
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
32
|
-
'accounts/%{account_id}/targeting_criteria'
|
33
|
-
RESOURCE_BATCH = "/#{TwitterAds::API_VERSION}/"
|
34
|
-
'batch/accounts/%{account_id}/targeting_criteria'
|
35
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
36
|
-
'accounts/%{account_id}/targeting_criteria/%{id}'
|
31
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
32
|
+
'accounts/%{account_id}/targeting_criteria' # @api private
|
33
|
+
RESOURCE_BATCH = "/#{TwitterAds::API_VERSION}/" \
|
34
|
+
'batch/accounts/%{account_id}/targeting_criteria' # @api private
|
35
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
36
|
+
'accounts/%{account_id}/targeting_criteria/%{id}' # @api private
|
37
37
|
|
38
38
|
def initialize(account)
|
39
39
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Tweet
|
@@ -7,16 +7,12 @@ module TwitterAds
|
|
7
7
|
# cannot instaniate Tweet, only including class methods for stats
|
8
8
|
extend TwitterAds::Analytics::ClassMethods
|
9
9
|
|
10
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
11
|
-
'accounts/%{account_id}/tweet/preview'
|
12
|
-
|
13
|
-
'
|
14
|
-
|
15
|
-
'
|
16
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
17
|
-
'accounts/%{account_id}/tweet/preview/%{id}'.freeze # @api private
|
18
|
-
RESOURCE_CREATE = "/#{TwitterAds::API_VERSION}/" +
|
19
|
-
'accounts/%{account_id}/tweet'.freeze # @api private
|
10
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
11
|
+
'accounts/%{account_id}/tweet/preview' # @api private
|
12
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
13
|
+
'accounts/%{account_id}/tweet/preview/%{id}' # @api private
|
14
|
+
RESOURCE_CREATE = "/#{TwitterAds::API_VERSION}/" \
|
15
|
+
'accounts/%{account_id}/tweet' # @api private
|
20
16
|
|
21
17
|
class << self
|
22
18
|
|
data/lib/twitter-ads/client.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
|
6
|
-
API_VERSION = '5'
|
6
|
+
API_VERSION = '5'
|
7
7
|
|
8
8
|
# The Ads API Client class which functions as a
|
9
9
|
# container for basic API consumer information.
|
@@ -13,8 +13,7 @@ module TwitterAds
|
|
13
13
|
:consumer_secret,
|
14
14
|
:access_token,
|
15
15
|
:access_token_secret,
|
16
|
-
:options
|
17
|
-
:logger
|
16
|
+
:options
|
18
17
|
|
19
18
|
# Creates a new Ads API client instance.
|
20
19
|
#
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -22,10 +22,10 @@ module TwitterAds
|
|
22
22
|
property :media_id
|
23
23
|
property :video_id
|
24
24
|
|
25
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
26
|
-
'accounts/%{account_id}/account_media'
|
27
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
28
|
-
'accounts/%{account_id}/account_media/%{id}'
|
25
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
26
|
+
'accounts/%{account_id}/account_media' # @api private
|
27
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
28
|
+
'accounts/%{account_id}/account_media/%{id}' # @api private
|
29
29
|
|
30
30
|
def initialize(account)
|
31
31
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -72,9 +72,9 @@ module TwitterAds
|
|
72
72
|
property :id, read_only: true
|
73
73
|
|
74
74
|
FETCH_URI = "/#{TwitterAds::API_VERSION}/" +
|
75
|
-
'accounts/%{account_id}/cards/all'
|
75
|
+
'accounts/%{account_id}/cards/all' # @api private
|
76
76
|
FETCH_ID = "/#{TwitterAds::API_VERSION}/" +
|
77
|
-
'accounts/%{account_id}/cards/all/%{id}'
|
77
|
+
'accounts/%{account_id}/cards/all/%{id}' # @api private
|
78
78
|
|
79
79
|
def all(*)
|
80
80
|
raise ArgumentError.new(
|
@@ -87,17 +87,19 @@ module TwitterAds
|
|
87
87
|
'Please supply one or the other, but not both.')
|
88
88
|
end
|
89
89
|
|
90
|
+
params = {}.merge!(opts)
|
91
|
+
|
90
92
|
if with_deleted && TwitterAds::Utils.to_bool(with_deleted)
|
91
|
-
params = { with_deleted: true }.merge!(
|
93
|
+
params = { with_deleted: true }.merge!(params)
|
92
94
|
end
|
93
95
|
|
94
96
|
if card_uris
|
95
|
-
params = { card_uris: Array(card_uris).join(',') }.merge!(
|
97
|
+
params = { card_uris: Array(card_uris).join(',') }.merge!(params)
|
96
98
|
resource = FETCH_URI % { account_id: account.id }
|
97
99
|
request = Request.new(account.client, :get, resource, params: params)
|
98
100
|
return Cursor.new(self.class, request, init_with: [account])
|
99
101
|
else
|
100
|
-
params = { card_id: card_id }.merge!(
|
102
|
+
params = { card_id: card_id }.merge!(params)
|
101
103
|
resource = FETCH_ID % { account_id: account.id, id: card_id }
|
102
104
|
response = Request.new(account.client, :get, resource, params: params).perform
|
103
105
|
return from_response(response.body[:data])
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -33,10 +33,10 @@ module TwitterAds
|
|
33
33
|
property :name
|
34
34
|
property :wide_app_image_media_id
|
35
35
|
|
36
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
37
|
-
'accounts/%{account_id}/cards/image_app_download'
|
38
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
39
|
-
'accounts/%{account_id}/cards/image_app_download/%{id}'
|
36
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
37
|
+
'accounts/%{account_id}/cards/image_app_download' # @api private
|
38
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
39
|
+
'accounts/%{account_id}/cards/image_app_download/%{id}' # @api private
|
40
40
|
|
41
41
|
def initialize(account)
|
42
42
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -35,10 +35,10 @@ module TwitterAds
|
|
35
35
|
property :third_cta_tweet
|
36
36
|
property :title
|
37
37
|
|
38
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
39
|
-
'accounts/%{account_id}/cards/image_conversation'
|
40
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
41
|
-
'accounts/%{account_id}/cards/image_conversation/%{id}'
|
38
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
39
|
+
'accounts/%{account_id}/cards/image_conversation' # @api private
|
40
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
41
|
+
'accounts/%{account_id}/cards/image_conversation/%{id}' # @api private
|
42
42
|
|
43
43
|
def initialize(account)
|
44
44
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -9,6 +9,7 @@ module TwitterAds
|
|
9
9
|
include TwitterAds::DSL
|
10
10
|
include TwitterAds::Resource
|
11
11
|
include TwitterAds::Persistence
|
12
|
+
include TwitterAds::Analytics
|
12
13
|
|
13
14
|
attr_reader :account
|
14
15
|
|
@@ -23,10 +24,10 @@ module TwitterAds
|
|
23
24
|
property :line_item_id
|
24
25
|
property :landing_url
|
25
26
|
|
26
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
27
|
-
'accounts/%{account_id}/media_creatives'
|
28
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
29
|
-
'accounts/%{account_id}/media_creatives/%{id}'
|
27
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
28
|
+
'accounts/%{account_id}/media_creatives' # @api private
|
29
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
30
|
+
'accounts/%{account_id}/media_creatives/%{id}' # @api private
|
30
31
|
|
31
32
|
def initialize(account)
|
32
33
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -35,10 +35,10 @@ module TwitterAds
|
|
35
35
|
property :poster_image_media_key
|
36
36
|
property :title
|
37
37
|
|
38
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
39
|
-
'accounts/%{account_id}/media_library'
|
40
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
41
|
-
'accounts/%{account_id}/media_library/%{id}'
|
38
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
39
|
+
'accounts/%{account_id}/media_library' # @api private
|
40
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
41
|
+
'accounts/%{account_id}/media_library/%{id}' # @api private
|
42
42
|
|
43
43
|
def reload(account, opts = {})
|
44
44
|
if @media_key
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -40,10 +40,10 @@ module TwitterAds
|
|
40
40
|
property :third_choice
|
41
41
|
property :fourth_choice
|
42
42
|
|
43
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
44
|
-
'accounts/%{account_id}/cards/poll'
|
45
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/"
|
46
|
-
'accounts/%{account_id}/cards/poll/%{id}'
|
43
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
44
|
+
'accounts/%{account_id}/cards/poll' # @api private
|
45
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
46
|
+
'accounts/%{account_id}/cards/poll/%{id}' # @api private
|
47
47
|
|
48
48
|
def initialize(account)
|
49
49
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -23,14 +23,10 @@ module TwitterAds
|
|
23
23
|
property :user_id
|
24
24
|
property :paused, type: :bool
|
25
25
|
|
26
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
27
|
-
'accounts/%{account_id}/promoted_accounts'
|
28
|
-
|
29
|
-
'
|
30
|
-
RESOURCE_ASYNC_STATS = "/#{TwitterAds::API_VERSION}/" +
|
31
|
-
'stats/jobs/accounts/%{account_id}'.freeze # @api private
|
32
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
33
|
-
'accounts/%{account_id}/promoted_accounts/%{id}'.freeze # @api private
|
26
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
27
|
+
'accounts/%{account_id}/promoted_accounts' # @api private
|
28
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
29
|
+
'accounts/%{account_id}/promoted_accounts/%{id}' # @api private
|
34
30
|
|
35
31
|
def initialize(account)
|
36
32
|
@account = account
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# Copyright (C)
|
2
|
+
# Copyright (C) 2019 Twitter, Inc.
|
3
3
|
|
4
4
|
module TwitterAds
|
5
5
|
module Creative
|
@@ -23,14 +23,10 @@ module TwitterAds
|
|
23
23
|
property :line_item_id
|
24
24
|
property :tweet_id
|
25
25
|
|
26
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/"
|
27
|
-
'accounts/%{account_id}/promoted_tweets'
|
28
|
-
|
29
|
-
'
|
30
|
-
RESOURCE_ASYNC_STATS = "/#{TwitterAds::API_VERSION}/" +
|
31
|
-
'stats/jobs/accounts/%{account_id}'.freeze # @api private
|
32
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
33
|
-
'accounts/%{account_id}/promoted_tweets/%{id}'.freeze # @api private
|
26
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
|
27
|
+
'accounts/%{account_id}/promoted_tweets' # @api private
|
28
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" \
|
29
|
+
'accounts/%{account_id}/promoted_tweets/%{id}' # @api private
|
34
30
|
|
35
31
|
def initialize(account)
|
36
32
|
@account = account
|