twitter-ads 10.0.0 → 11.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,42 @@
1
+ {
2
+ "request": {
3
+ "params": {
4
+ "account_id": "2iqph",
5
+ "card_id": "1503831318555086849"
6
+ }
7
+ },
8
+ "data": {
9
+ "name": "my new card",
10
+ "components": [
11
+ {
12
+ "media_key": "13_794652834998325248",
13
+ "media_metadata": {
14
+ "13_794652834998325248": {
15
+ "type": "VIDEO",
16
+ "url": "https://video.twimg.com/amplify_video/794652834998325248/vid/640x360/pUgE2UKcfPwF_5Uh.mp4",
17
+ "width": 640,
18
+ "height": 360,
19
+ "video_duration": 7967,
20
+ "video_aspect_ratio": "16:9"
21
+ }
22
+ },
23
+ "type": "MEDIA"
24
+ },
25
+ {
26
+ "title": "Twitter",
27
+ "destination": {
28
+ "url": "http://twitter.com/login",
29
+ "type": "WEBSITE"
30
+ },
31
+ "type": "DETAILS"
32
+ }
33
+ ],
34
+ "id": "1503831318555086849",
35
+ "created_at": "2022-03-15T20:31:40Z",
36
+ "card_uri": "card://1503831318555086849",
37
+ "updated_at": "2022-03-15T20:31:40Z",
38
+ "deleted": false,
39
+ "card_type": "VIDEO_WEBSITE"
40
+ }
41
+ }
42
+
@@ -44,6 +44,7 @@ describe TwitterAds::LineItem do
44
44
  total_budget_amount_local_micro
45
45
  goal
46
46
  ios_app_store_identifier
47
+ standard_delivery
47
48
  )
48
49
  include_examples 'object property check', read, write
49
50
 
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # Copyright (C) 2019 Twitter, Inc.
3
+
4
+ require 'spec_helper'
5
+
6
+ include TwitterAds::Enum
7
+
8
+ describe TwitterAds::Creative::Cards do
9
+
10
+ let!(:resource) { "#{ADS_API}/accounts/2iqph/cards" }
11
+
12
+ before(:each) do
13
+ stub_fixture(:get, :accounts_load, "#{ADS_API}/accounts/2iqph")
14
+
15
+ resource_collection = "#{ADS_API}/accounts/#{account.id}/cards"
16
+ stub_fixture(:get, :cards_all, resource_collection)
17
+
18
+ resource = "#{ADS_API}/accounts/#{account.id}/cards/1508693734346485761"
19
+ stub_fixture(:get, :cards_load, /#{resource}\?.*/)
20
+ end
21
+
22
+ let(:client) do
23
+ Client.new(
24
+ Faker::Lorem.characters(40),
25
+ Faker::Lorem.characters(40),
26
+ Faker::Lorem.characters(40),
27
+ Faker::Lorem.characters(40)
28
+ )
29
+ end
30
+
31
+ let(:account) { client.accounts('2iqph') }
32
+
33
+ it 'inspect Cards.load() response' do
34
+ card = described_class.load(account, '1508693734346485761')
35
+
36
+ expect(card).to be_instance_of(TwitterAds::Creative::Cards)
37
+ expect(card.id).to eq '1503831318555086849'
38
+ expect(card.card_type).to eq 'VIDEO_WEBSITE'
39
+ expect(card.card_uri).to eq 'card://1503831318555086849'
40
+ end
41
+
42
+ it 'inspect Cards.all() response' do
43
+ cards = described_class.all(account)
44
+
45
+ expect(cards).to be_instance_of(Cursor)
46
+ card = cards.first
47
+ expect(card.id).to eq '1340029888649076737'
48
+ expect(card.card_type).to eq 'VIDEO_WEBSITE'
49
+ expect(card.card_uri).to eq 'card://1340029888649076737'
50
+ end
51
+
52
+ end
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: 10.0.0
4
+ version: 11.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Babich
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-11-18 00:00:00.000000000 Z
15
+ date: 2022-05-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: multi_json
@@ -75,7 +75,6 @@ files:
75
75
  - lib/twitter-ads/creative/cards.rb
76
76
  - lib/twitter-ads/creative/cards_fetch.rb
77
77
  - lib/twitter-ads/creative/draft_tweet.rb
78
- - lib/twitter-ads/creative/image_app_download_card.rb
79
78
  - lib/twitter-ads/creative/image_conversation_card.rb
80
79
  - lib/twitter-ads/creative/media_creative.rb
81
80
  - lib/twitter-ads/creative/media_library.rb
@@ -85,10 +84,7 @@ files:
85
84
  - lib/twitter-ads/creative/scheduled_tweet.rb
86
85
  - lib/twitter-ads/creative/tweet_previews.rb
87
86
  - lib/twitter-ads/creative/tweets.rb
88
- - lib/twitter-ads/creative/video_app_download_card.rb
89
87
  - lib/twitter-ads/creative/video_conversation_card.rb
90
- - lib/twitter-ads/creative/video_website_card.rb
91
- - lib/twitter-ads/creative/website_card.rb
92
88
  - lib/twitter-ads/cursor.rb
93
89
  - lib/twitter-ads/enum.rb
94
90
  - lib/twitter-ads/error.rb
@@ -128,6 +124,8 @@ files:
128
124
  - spec/fixtures/audience_estimate.json
129
125
  - spec/fixtures/campaigns_all.json
130
126
  - spec/fixtures/campaigns_load.json
127
+ - spec/fixtures/cards_all.json
128
+ - spec/fixtures/cards_load.json
131
129
  - spec/fixtures/custom_audiences_all.json
132
130
  - spec/fixtures/custom_audiences_load.json
133
131
  - spec/fixtures/funding_instruments_all.json
@@ -159,6 +157,7 @@ files:
159
157
  - spec/twitter-ads/campaign/tracking_tag_spec.rb
160
158
  - spec/twitter-ads/campaign/tweet_spec.rb
161
159
  - spec/twitter-ads/client_spec.rb
160
+ - spec/twitter-ads/creative/cards_spec.rb
162
161
  - spec/twitter-ads/creative/media_creative_spec.rb
163
162
  - spec/twitter-ads/creative/promoted_account_spec.rb
164
163
  - spec/twitter-ads/creative/promoted_tweet_spec.rb
@@ -189,57 +188,60 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
188
  - !ruby/object:Gem::Version
190
189
  version: 2.6.0
191
190
  requirements: []
192
- rubygems_version: 3.2.22
191
+ rubygems_version: 3.1.6
193
192
  signing_key:
194
193
  specification_version: 4
195
194
  summary: The officially supported Twitter Ads API SDK for Ruby.
196
195
  test_files:
197
- - spec/fixtures/accounts_all.json
198
- - spec/fixtures/accounts_features.json
199
- - spec/fixtures/accounts_load.json
196
+ - spec/quality_spec.rb
197
+ - spec/fixtures/promoted_tweets_all.json
200
198
  - spec/fixtures/app_lists_all.json
199
+ - spec/fixtures/accounts_features.json
200
+ - spec/fixtures/tracking_tags_load.json
201
+ - spec/fixtures/line_items_load.json
202
+ - spec/fixtures/line_items_all.json
203
+ - spec/fixtures/campaigns_load.json
201
204
  - spec/fixtures/app_lists_load.json
202
- - spec/fixtures/audience_estimate.json
203
205
  - spec/fixtures/campaigns_all.json
204
- - spec/fixtures/campaigns_load.json
205
- - spec/fixtures/custom_audiences_all.json
206
- - spec/fixtures/custom_audiences_load.json
207
- - spec/fixtures/funding_instruments_all.json
206
+ - spec/fixtures/tailored_audiences_all.json
207
+ - spec/fixtures/tweet_previews.json
208
208
  - spec/fixtures/funding_instruments_load.json
209
- - spec/fixtures/line_items_all.json
210
- - spec/fixtures/line_items_load.json
211
- - spec/fixtures/no_content.json
212
- - spec/fixtures/placements.json
213
- - spec/fixtures/promotable_users_all.json
209
+ - spec/fixtures/accounts_load.json
210
+ - spec/fixtures/cards_all.json
211
+ - spec/fixtures/videos_load.json
212
+ - spec/fixtures/videos_all.json
214
213
  - spec/fixtures/promotable_users_load.json
215
- - spec/fixtures/promoted_tweets_all.json
216
- - spec/fixtures/promoted_tweets_load.json
214
+ - spec/fixtures/accounts_all.json
217
215
  - spec/fixtures/reach_estimate.json
218
- - spec/fixtures/tailored_audiences_all.json
219
216
  - spec/fixtures/targeted_audiences.json
220
- - spec/fixtures/tracking_tags_load.json
221
- - spec/fixtures/tweet_previews.json
222
- - spec/fixtures/videos_all.json
223
- - spec/fixtures/videos_load.json
224
- - spec/quality_spec.rb
217
+ - spec/fixtures/audience_estimate.json
218
+ - spec/fixtures/promoted_tweets_load.json
219
+ - spec/fixtures/custom_audiences_load.json
220
+ - spec/fixtures/funding_instruments_all.json
221
+ - spec/fixtures/promotable_users_all.json
222
+ - spec/fixtures/placements.json
223
+ - spec/fixtures/cards_load.json
224
+ - spec/fixtures/no_content.json
225
+ - spec/fixtures/custom_audiences_all.json
225
226
  - spec/shared/properties.rb
226
- - spec/spec_helper.rb
227
227
  - spec/support/helpers.rb
228
+ - spec/twitter-ads/placements_spec.rb
228
229
  - spec/twitter-ads/account_spec.rb
229
- - spec/twitter-ads/audiences/custom_audience_spec.rb
230
- - spec/twitter-ads/campaign/app_list_spec.rb
231
- - spec/twitter-ads/campaign/line_item_spec.rb
230
+ - spec/twitter-ads/retry_count_spec.rb
231
+ - spec/twitter-ads/client_spec.rb
232
232
  - spec/twitter-ads/campaign/targeting_criteria_spec.rb
233
- - spec/twitter-ads/campaign/tracking_tag_spec.rb
233
+ - spec/twitter-ads/campaign/line_item_spec.rb
234
234
  - spec/twitter-ads/campaign/tweet_spec.rb
235
- - spec/twitter-ads/client_spec.rb
236
- - spec/twitter-ads/creative/media_creative_spec.rb
235
+ - spec/twitter-ads/campaign/tracking_tag_spec.rb
236
+ - spec/twitter-ads/campaign/app_list_spec.rb
237
+ - spec/twitter-ads/utils_spec.rb
238
+ - spec/twitter-ads/audiences/custom_audience_spec.rb
239
+ - spec/twitter-ads/cursor_spec.rb
240
+ - spec/twitter-ads/creative/cards_spec.rb
237
241
  - spec/twitter-ads/creative/promoted_account_spec.rb
238
242
  - spec/twitter-ads/creative/promoted_tweet_spec.rb
239
243
  - spec/twitter-ads/creative/tweet_previews_spec.rb
240
- - spec/twitter-ads/cursor_spec.rb
241
- - spec/twitter-ads/placements_spec.rb
244
+ - spec/twitter-ads/creative/media_creative_spec.rb
242
245
  - spec/twitter-ads/rate_limit_spec.rb
243
- - spec/twitter-ads/retry_count_spec.rb
244
246
  - spec/twitter-ads/targeting/audience_estimate_spec.rb
245
- - spec/twitter-ads/utils_spec.rb
247
+ - spec/spec_helper.rb
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
- # Copyright (C) 2019 Twitter, Inc.
3
-
4
- module TwitterAds
5
- module Creative
6
-
7
- class ImageAppDownloadCard
8
-
9
- include TwitterAds::DSL
10
- include TwitterAds::Resource
11
- include TwitterAds::Persistence
12
-
13
- attr_reader :account
14
-
15
- property :card_type, read_only: true
16
- property :card_uri, read_only: true
17
- property :created_at, type: :time, read_only: true
18
- property :deleted, type: :bool, read_only: true
19
- property :id, read_only: true
20
- property :image_display_height, read_only: true
21
- property :image_display_width, read_only: true
22
- property :updated_at, type: :time, read_only: true
23
- property :media_url, read_only: true
24
-
25
- property :country_code
26
- property :app_cta
27
- property :googleplay_app_id
28
- property :googleplay_deep_link
29
- property :ios_app_store_identifier
30
- property :ios_deep_link
31
- property :name
32
- property :media_key
33
-
34
- RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
35
- 'accounts/%{account_id}/cards/image_app_download' # @api private
36
- RESOURCE = "/#{TwitterAds::API_VERSION}/" \
37
- 'accounts/%{account_id}/cards/image_app_download/%{id}' # @api private
38
-
39
- def initialize(account)
40
- @account = account
41
- self
42
- end
43
-
44
- end
45
-
46
- end
47
- end
@@ -1,48 +0,0 @@
1
- # frozen_string_literal: true
2
- # Copyright (C) 2019 Twitter, Inc.
3
-
4
- module TwitterAds
5
- module Creative
6
-
7
- class VideoAppDownloadCard
8
-
9
- include TwitterAds::DSL
10
- include TwitterAds::Resource
11
- include TwitterAds::Persistence
12
-
13
- attr_reader :account
14
-
15
- property :card_type, read_only: true
16
- property :card_uri, read_only: true
17
- property :created_at, type: :time, read_only: true
18
- property :deleted, type: :bool, read_only: true
19
- property :id, read_only: true
20
- property :updated_at, type: :time, read_only: true
21
- property :video_owner_id, read_only: true
22
- property :poster_media_url, read_only: true
23
- property :media_url, read_only: true
24
-
25
- property :country_code
26
- property :app_cta
27
- property :poster_media_key
28
- property :ios_app_store_identifier
29
- property :ios_deep_link
30
- property :googleplay_app_id
31
- property :googleplay_deep_link
32
- property :name
33
- property :media_key
34
-
35
- RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" \
36
- 'accounts/%{account_id}/cards/video_app_download' # @api private
37
- RESOURCE = "/#{TwitterAds::API_VERSION}/" \
38
- 'accounts/%{account_id}/cards/video_app_download/%{id}' # @api private
39
-
40
- def initialize(account)
41
- @account = account
42
- self
43
- end
44
-
45
- end
46
-
47
- end
48
- end
@@ -1,50 +0,0 @@
1
- # frozen_string_literal: true
2
- # Copyright (C) 2019 Twitter, Inc.
3
-
4
- module TwitterAds
5
- module Creative
6
-
7
- class VideoWebsiteCard
8
-
9
- include TwitterAds::DSL
10
- include TwitterAds::Resource
11
- include TwitterAds::Persistence
12
-
13
- attr_reader :account
14
-
15
- property :account_id, read_only: true
16
- property :card_type, read_only: true
17
- property :card_uri, read_only: true
18
- property :created_at, type: :time, read_only: true
19
- property :deleted, type: :bool, read_only: true
20
- property :id, read_only: true
21
- property :updated_at, type: :time, read_only: true
22
- property :video_height, read_only: true
23
- property :video_owner_id, read_only: true
24
- property :video_poster_height, read_only: true
25
- property :poster_media_url, read_only: true
26
- property :video_poster_width, read_only: true
27
- property :media_url, read_only: true
28
- property :video_width, read_only: true
29
- property :website_display_url, read_only: true
30
- property :website_dest_url, read_only: true
31
-
32
- property :name
33
- property :title
34
- property :media_key
35
- property :website_url
36
-
37
- RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/accounts/%{account_id}/cards/video_website"
38
- # @api private
39
- RESOURCE = "/#{TwitterAds::API_VERSION}/" \
40
- 'accounts/%{account_id}/cards/video_website/%{id}' # @api private
41
-
42
- def initialize(account)
43
- @account = account
44
- self
45
- end
46
-
47
- end
48
-
49
- end
50
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
- # Copyright (C) 2019 Twitter, Inc.
3
-
4
- module TwitterAds
5
- module Creative
6
-
7
- class WebsiteCard
8
-
9
- include TwitterAds::DSL
10
- include TwitterAds::Resource
11
- include TwitterAds::Persistence
12
-
13
- attr_reader :account
14
-
15
- property :card_type, read_only: true
16
- property :card_uri, read_only: true
17
- property :created_at, type: :time, read_only: true
18
- property :deleted, type: :bool, read_only: true
19
- property :id, read_only: true
20
- property :media_url, read_only: true
21
- property :image_display_height, read_only: true
22
- property :image_display_width, read_only: true
23
- property :updated_at, type: :time, read_only: true
24
- property :website_dest_url, read_only: true
25
- property :website_display_url, read_only: true
26
-
27
- property :media_key
28
- property :name
29
- property :website_title
30
- property :website_url
31
-
32
- RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/accounts/%{account_id}/cards/website"
33
- # @api private
34
- RESOURCE = "/#{TwitterAds::API_VERSION}/accounts/%{account_id}/cards/website/%{id}"
35
- # @api private
36
-
37
- def initialize(account)
38
- @account = account
39
- self
40
- end
41
-
42
- end
43
-
44
- end
45
- end