twitter-ads 10.1.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/twitter-ads/campaign/campaign.rb +1 -2
- data/lib/twitter-ads/campaign/line_item.rb +1 -2
- data/lib/twitter-ads/client.rb +1 -1
- data/lib/twitter-ads/creative/cards.rb +31 -22
- data/lib/twitter-ads/creative/draft_tweet.rb +0 -1
- data/lib/twitter-ads/enum.rb +4 -0
- data/lib/twitter-ads/resources/analytics.rb +0 -1
- data/lib/twitter-ads/version.rb +1 -1
- data/lib/twitter-ads.rb +0 -4
- data/spec/fixtures/cards_all.json +836 -0
- data/spec/fixtures/cards_load.json +42 -0
- data/spec/twitter-ads/campaign/line_item_spec.rb +1 -0
- data/spec/twitter-ads/creative/cards_spec.rb +52 -0
- metadata +47 -45
- data/lib/twitter-ads/creative/image_app_download_card.rb +0 -47
- data/lib/twitter-ads/creative/video_app_download_card.rb +0 -48
- data/lib/twitter-ads/creative/video_website_card.rb +0 -50
- data/lib/twitter-ads/creative/website_card.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67928f3af10643b8b98513d2411b0f560103f8a6491d816fa25e99ffdd8362d9
|
4
|
+
data.tar.gz: '044490baf9cfab6e87b46a6d03a4b6b15bf44b3b5aa2e307bd9cd9137fdb72a9'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 395df768253f0f424c7d13c12004711aaae69c3b55f2c8a4f992b778b4fb7656dc41b2a79df9e00c3c31ec38851cc9a7059129c4b88b4717b86a8ba08bc7f5cd
|
7
|
+
data.tar.gz: 27d317c21e27631d3b09187c20c52934055f585a45e2e91af073abdfdf0c62c77d7ac9fe9b598a9583aad581dea944dd66eb265fddf7902c11dd701c539cc080
|
@@ -20,14 +20,13 @@ module TwitterAds
|
|
20
20
|
|
21
21
|
property :name
|
22
22
|
property :funding_instrument_id
|
23
|
-
property :end_time, type: :time
|
24
|
-
property :start_time, type: :time
|
25
23
|
property :entity_status
|
26
24
|
property :effective_status
|
27
25
|
property :currency
|
28
26
|
property :standard_delivery
|
29
27
|
property :daily_budget_amount_local_micro
|
30
28
|
property :total_budget_amount_local_micro
|
29
|
+
property :budget_optimization
|
31
30
|
|
32
31
|
# sdk only
|
33
32
|
property :to_delete, type: :bool
|
@@ -34,9 +34,8 @@ module TwitterAds
|
|
34
34
|
property :primary_web_event_tag
|
35
35
|
property :product_type
|
36
36
|
property :start_time, type: :time
|
37
|
+
property :standard_delivery, type: :bool
|
37
38
|
property :total_budget_amount_local_micro
|
38
|
-
|
39
|
-
# beta (not yet generally available)
|
40
39
|
property :advertiser_user_id
|
41
40
|
|
42
41
|
# sdk only
|
data/lib/twitter-ads/client.rb
CHANGED
@@ -12,36 +12,46 @@ module TwitterAds
|
|
12
12
|
|
13
13
|
attr_reader :account
|
14
14
|
|
15
|
+
property :id, read_only: true
|
16
|
+
property :card_type, read_only: true
|
15
17
|
property :card_uri, read_only: true
|
16
18
|
property :created_at, type: :time, read_only: true
|
17
19
|
property :deleted, type: :bool, read_only: true
|
18
20
|
property :updated_at, type: :time, read_only: true
|
19
21
|
# these are writable, but not in the sense that they can be set on an object and then saved
|
20
|
-
property :name
|
21
|
-
property :components
|
22
|
+
property :name
|
23
|
+
property :components
|
22
24
|
|
23
25
|
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
24
|
-
'accounts/%{account_id}/cards' # @api private
|
26
|
+
'accounts/%{account_id}/cards/%{id}' # @api private
|
27
|
+
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" +
|
28
|
+
'accounts/%{account_id}/cards' # @api private
|
25
29
|
|
26
|
-
def
|
27
|
-
raise ArgumentError.new(
|
28
|
-
"'Cards' object has no attribute 'load'")
|
29
|
-
end
|
30
|
-
|
31
|
-
def reload(*)
|
32
|
-
raise ArgumentError.new(
|
33
|
-
"'Cards' object has no attribute 'reload'")
|
34
|
-
end
|
35
|
-
|
36
|
-
def create(account, name, components)
|
37
|
-
resource = RESOURCE % { account_id: account.id }
|
38
|
-
params = { 'name': name, 'components': components }
|
30
|
+
def save
|
39
31
|
headers = { 'Content-Type' => 'application/json' }
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
32
|
+
params = { 'name': name, 'components': components }
|
33
|
+
if @id
|
34
|
+
resource = RESOURCE % {
|
35
|
+
account_id: account.id,
|
36
|
+
id: id
|
37
|
+
}
|
38
|
+
request = Request.new(account.client,
|
39
|
+
:put,
|
40
|
+
resource,
|
41
|
+
headers: headers,
|
42
|
+
body: params.to_json)
|
43
|
+
else
|
44
|
+
resource = RESOURCE_COLLECTION % {
|
45
|
+
account_id: account.id
|
46
|
+
}
|
47
|
+
request = Request.new(account.client,
|
48
|
+
:post,
|
49
|
+
resource,
|
50
|
+
headers: headers,
|
51
|
+
body: params.to_json)
|
52
|
+
end
|
53
|
+
|
54
|
+
response = request.perform
|
45
55
|
from_response(response.body[:data])
|
46
56
|
end
|
47
57
|
|
@@ -49,7 +59,6 @@ module TwitterAds
|
|
49
59
|
@account = account
|
50
60
|
self
|
51
61
|
end
|
52
|
-
|
53
62
|
end
|
54
63
|
|
55
64
|
end
|
data/lib/twitter-ads/enum.rb
CHANGED
data/lib/twitter-ads/version.rb
CHANGED
data/lib/twitter-ads.rb
CHANGED
@@ -60,7 +60,6 @@ require 'twitter-ads/targeting_criteria/app_store_category'
|
|
60
60
|
require 'twitter-ads/creative/account_media'
|
61
61
|
require 'twitter-ads/creative/cards_fetch'
|
62
62
|
require 'twitter-ads/creative/cards'
|
63
|
-
require 'twitter-ads/creative/image_app_download_card'
|
64
63
|
require 'twitter-ads/creative/image_conversation_card'
|
65
64
|
require 'twitter-ads/creative/media_creative'
|
66
65
|
require 'twitter-ads/creative/media_library'
|
@@ -68,10 +67,7 @@ require 'twitter-ads/creative/promoted_account'
|
|
68
67
|
require 'twitter-ads/creative/promoted_tweet'
|
69
68
|
require 'twitter-ads/creative/scheduled_tweet'
|
70
69
|
require 'twitter-ads/creative/draft_tweet'
|
71
|
-
require 'twitter-ads/creative/video_app_download_card'
|
72
70
|
require 'twitter-ads/creative/video_conversation_card'
|
73
|
-
require 'twitter-ads/creative/video_website_card'
|
74
|
-
require 'twitter-ads/creative/website_card'
|
75
71
|
require 'twitter-ads/creative/poll_cards'
|
76
72
|
require 'twitter-ads/creative/tweet_previews'
|
77
73
|
require 'twitter-ads/creative/tweets'
|