twitter-ads 3.0.0 → 4.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.rb +3 -1
- data/lib/twitter-ads/account.rb +0 -14
- data/lib/twitter-ads/audiences/tailored_audience.rb +66 -0
- data/lib/twitter-ads/campaign/line_item.rb +1 -0
- data/lib/twitter-ads/creative/cards_fetch.rb +1 -1
- data/lib/twitter-ads/creative/image_app_download_card.rb +1 -1
- data/lib/twitter-ads/creative/video_app_download_card.rb +1 -1
- data/lib/twitter-ads/enum.rb +5 -0
- data/lib/twitter-ads/settings/tax.rb +52 -0
- data/lib/twitter-ads/settings/user.rb +31 -0
- data/lib/twitter-ads/version.rb +1 -1
- data/spec/twitter-ads/account_spec.rb +0 -37
- data/spec/twitter-ads/creative/image_app_download_card_spec.rb +1 -1
- data/spec/twitter-ads/creative/video_app_download_card_spec.rb +1 -1
- data/twitter-ads.gemspec +1 -1
- metadata +7 -32
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -2
- data/lib/twitter-ads/creative/video.rb +0 -49
- data/spec/twitter-ads/creative/video_legacy_spec.rb +0 -43
- data/spec/twitter-ads/creative/video_spec.rb +0 -43
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fb4befdf5ee2d5b88722ae972166970cf2595b6
|
4
|
+
data.tar.gz: 8665ca5d969a1a03f13a8c0dcf57719a1523936a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795e91e3a932600ed0d67c52b74006e8f08819464d51d1a968af96e31c4dbbeb37ccca49e0fcf98014e47fe2ba850f900e855c8fa3dd1dcd618e24cb3aaa7e43
|
7
|
+
data.tar.gz: 369d6ec2a92a433f591b1ed3482a85ff51a4294ab3cfa6be7792a5540b6d93088de737bcbc1f392caaec2bee1c4385b955faf02262835005dd417d17c833ea2f
|
data/lib/twitter-ads.rb
CHANGED
@@ -69,7 +69,6 @@ require 'twitter-ads/creative/video_app_download_card'
|
|
69
69
|
require 'twitter-ads/creative/video_conversation_card'
|
70
70
|
require 'twitter-ads/creative/video_website_card'
|
71
71
|
require 'twitter-ads/creative/website_card'
|
72
|
-
require 'twitter-ads/creative/video'
|
73
72
|
require 'twitter-ads/creative/poll_cards'
|
74
73
|
|
75
74
|
require 'twitter-ads/targeting/reach_estimate'
|
@@ -77,4 +76,7 @@ require 'twitter-ads/targeting/reach_estimate'
|
|
77
76
|
require 'twitter-ads/measurement/web_event_tag'
|
78
77
|
require 'twitter-ads/measurement/app_event_tag'
|
79
78
|
|
79
|
+
require 'twitter-ads/settings/user'
|
80
|
+
require 'twitter-ads/settings/tax'
|
81
|
+
|
80
82
|
require 'twitter-ads/legacy.rb'
|
data/lib/twitter-ads/account.rb
CHANGED
@@ -208,20 +208,6 @@ module TwitterAds
|
|
208
208
|
load_resource(TailoredAudience, id, opts)
|
209
209
|
end
|
210
210
|
|
211
|
-
# Returns a collection of videos available to the current account.
|
212
|
-
#
|
213
|
-
# @param id [String] The Video ID value.
|
214
|
-
# @param opts [Hash] A Hash of extended options.
|
215
|
-
# @option opts [Boolean] :with_deleted Indicates if deleted items should be included.
|
216
|
-
# @option opts [String] :sort_by The object param to sort the API response by.
|
217
|
-
#
|
218
|
-
# @since 0.3.0
|
219
|
-
#
|
220
|
-
# @return A Cursor or object instance.
|
221
|
-
def videos(id = nil, opts = {})
|
222
|
-
load_resource(Video, id, opts)
|
223
|
-
end
|
224
|
-
|
225
211
|
# Returns the most recent promotable Tweets created by one or more specified Twitter users.
|
226
212
|
#
|
227
213
|
# @param ids [Array] An Array of Twitter user IDs.
|
@@ -33,6 +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".freeze # @api private
|
36
39
|
# @api private
|
37
40
|
GLOBAL_OPT_OUT = "/#{TwitterAds::API_VERSION}/" +
|
38
41
|
'accounts/%{account_id}/tailored_audiences/global_opt_out'.freeze
|
@@ -86,6 +89,25 @@ module TwitterAds
|
|
86
89
|
end
|
87
90
|
end
|
88
91
|
|
92
|
+
# Creates a new tailored audience.
|
93
|
+
#
|
94
|
+
# @example
|
95
|
+
# audience = TailoredAudience.create_instance(account, 'my list')
|
96
|
+
#
|
97
|
+
# @param account [Account] The account object instance.
|
98
|
+
# @param name [String] The tailored audience name.
|
99
|
+
#
|
100
|
+
# @since 4.0
|
101
|
+
#
|
102
|
+
# @return [TailoredAudience] The newly created tailored audience instance.
|
103
|
+
def create_instance(account, name)
|
104
|
+
audience = new(account)
|
105
|
+
params = { name: name }
|
106
|
+
resource = RESOURCE_COLLECTION % { account_id: account.id }
|
107
|
+
response = Request.new(account.client, :post, resource, params: params).perform
|
108
|
+
audience.from_response(response.body[:data])
|
109
|
+
end
|
110
|
+
|
89
111
|
# Updates the global opt-out list for the specified advertiser account.
|
90
112
|
#
|
91
113
|
# @example
|
@@ -194,6 +216,50 @@ module TwitterAds
|
|
194
216
|
[success_count, total_count]
|
195
217
|
end
|
196
218
|
|
219
|
+
# This is a private API and requires whitelisting from Twitter.
|
220
|
+
#
|
221
|
+
# This endpoint will allow partners to add, update and remove users from a given
|
222
|
+
# tailored_audience_id.
|
223
|
+
# The endpoint will also accept multiple user identifier types per user as well.
|
224
|
+
#
|
225
|
+
# @example
|
226
|
+
# tailored_audience.users(
|
227
|
+
# account,
|
228
|
+
# [
|
229
|
+
# {
|
230
|
+
# "operation_type": "Update",
|
231
|
+
# "params": {
|
232
|
+
# "effective_at": "2018-05-15T00:00:00Z",
|
233
|
+
# "expires_at": "2019-01-01T07:00:00Z",
|
234
|
+
# "users": [
|
235
|
+
# {
|
236
|
+
# "twitter_id": [
|
237
|
+
# "4798b8bbdcf6f2a52e527f46a3d7a7c9aefb541afda03af79c74809ecc6376f3"
|
238
|
+
# ]
|
239
|
+
# }
|
240
|
+
# ]
|
241
|
+
# }
|
242
|
+
# }
|
243
|
+
# ]
|
244
|
+
# )
|
245
|
+
#
|
246
|
+
# @since 4.0
|
247
|
+
#
|
248
|
+
# @return success_count, total_count
|
249
|
+
def users(params)
|
250
|
+
resource = RESOURCE_USERS % { account_id: account.id, id: id }
|
251
|
+
headers = { 'Content-Type' => 'application/json' }
|
252
|
+
response = TwitterAds::Request.new(account.client,
|
253
|
+
:post,
|
254
|
+
resource,
|
255
|
+
headers: headers,
|
256
|
+
body: params.to_json).perform
|
257
|
+
success_count = response.body[:data][:success_count]
|
258
|
+
total_count = response.body[:data][:total_count]
|
259
|
+
|
260
|
+
[success_count, total_count]
|
261
|
+
end
|
262
|
+
|
197
263
|
private
|
198
264
|
|
199
265
|
def create_audience(name, list_type)
|
@@ -23,7 +23,7 @@ module TwitterAds
|
|
23
23
|
property :updated_at, type: :time, read_only: true
|
24
24
|
property :wide_app_image, read_only: true
|
25
25
|
|
26
|
-
property :
|
26
|
+
property :country_code
|
27
27
|
property :app_cta
|
28
28
|
property :googleplay_app_id
|
29
29
|
property :googleplay_deep_link
|
data/lib/twitter-ads/enum.rb
CHANGED
@@ -221,5 +221,10 @@ module TwitterAds
|
|
221
221
|
TARGETING_CRITERIA = 'TARGETING_CRITERIA'.freeze
|
222
222
|
KEYWORD_AUDIENCE = 'KEYWORD_AUDIENCE'.freeze
|
223
223
|
end
|
224
|
+
|
225
|
+
module LookalikeExpansion
|
226
|
+
DEFINED = 'DEFINED'.freeze
|
227
|
+
EXPANDED = 'EXPANDED'.freeze
|
228
|
+
end
|
224
229
|
end
|
225
230
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Copyright (C) 2015 Twitter, Inc.
|
3
|
+
|
4
|
+
module TwitterAds
|
5
|
+
class TaxSettings
|
6
|
+
|
7
|
+
include TwitterAds::DSL
|
8
|
+
include TwitterAds::Resource
|
9
|
+
include TwitterAds::Persistence
|
10
|
+
|
11
|
+
attr_reader :account
|
12
|
+
|
13
|
+
property :address_city
|
14
|
+
property :address_country
|
15
|
+
property :address_email
|
16
|
+
property :address_first_name
|
17
|
+
property :address_last_name
|
18
|
+
property :address_name
|
19
|
+
property :address_postal_code
|
20
|
+
property :address_region
|
21
|
+
property :address_street1
|
22
|
+
property :address_street2
|
23
|
+
property :bill_to
|
24
|
+
property :business_relationship
|
25
|
+
property :client_address_city
|
26
|
+
property :client_address_country
|
27
|
+
property :client_address_email
|
28
|
+
property :client_address_first_name
|
29
|
+
property :client_address_last_name
|
30
|
+
property :client_address_name
|
31
|
+
property :client_address_postal_code
|
32
|
+
property :client_address_region
|
33
|
+
property :client_address_street1
|
34
|
+
property :client_address_street2
|
35
|
+
property :invoice_jurisdiction
|
36
|
+
property :tax_category
|
37
|
+
property :tax_exemption_id
|
38
|
+
property :tax_id
|
39
|
+
|
40
|
+
# sdk only
|
41
|
+
property :to_delete, type: :bool
|
42
|
+
|
43
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
44
|
+
'accounts/%{account_id}/user_settings/%{id}'.freeze # @api private
|
45
|
+
|
46
|
+
def initialize(account)
|
47
|
+
@account = account
|
48
|
+
self
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Copyright (C) 2015 Twitter, Inc.
|
3
|
+
|
4
|
+
module TwitterAds
|
5
|
+
class UserSettings
|
6
|
+
|
7
|
+
include TwitterAds::DSL
|
8
|
+
include TwitterAds::Resource
|
9
|
+
include TwitterAds::Persistence
|
10
|
+
|
11
|
+
attr_reader :account
|
12
|
+
|
13
|
+
property :notification_email
|
14
|
+
property :contact_phone
|
15
|
+
property :contact_phone_extension
|
16
|
+
property :subscribed_email_types
|
17
|
+
property :user_id
|
18
|
+
|
19
|
+
# sdk only
|
20
|
+
property :to_delete, type: :bool
|
21
|
+
|
22
|
+
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
23
|
+
'accounts/%{account_id}/user_settings/%{id}'.freeze # @api private
|
24
|
+
|
25
|
+
def initialize(account)
|
26
|
+
@account = account
|
27
|
+
self
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
data/lib/twitter-ads/version.rb
CHANGED
@@ -275,41 +275,4 @@ describe TwitterAds::Account do
|
|
275
275
|
|
276
276
|
end
|
277
277
|
|
278
|
-
describe '#videos' do
|
279
|
-
|
280
|
-
let!(:video_id) { 'd5e3ae4d-34c4-4f49-894e-0c17735916a4' }
|
281
|
-
|
282
|
-
before(:each) do
|
283
|
-
resource_collection = "#{ADS_API}/accounts/#{account.id}/videos"
|
284
|
-
stub_fixture(:get, :videos_all, resource_collection)
|
285
|
-
|
286
|
-
resource = "#{ADS_API}/accounts/#{account.id}/videos/#{video_id}"
|
287
|
-
stub_fixture(:get, :videos_load, /#{resource}\?.*/)
|
288
|
-
end
|
289
|
-
|
290
|
-
context 'with an id specified' do
|
291
|
-
|
292
|
-
it 'successfully loads the specified video' do
|
293
|
-
result = account.videos(video_id)
|
294
|
-
expect(result).not_to be_nil
|
295
|
-
expect(result.class).to eq(TwitterAds::Video)
|
296
|
-
expect(result.id).to eq(video_id)
|
297
|
-
end
|
298
|
-
|
299
|
-
end
|
300
|
-
|
301
|
-
context 'without an id specified' do
|
302
|
-
|
303
|
-
it 'succesfully returns a cursor with all videos' do
|
304
|
-
result = account.videos
|
305
|
-
expect(result.to_a.size).to eq(3)
|
306
|
-
expect(result.class).to eq(TwitterAds::Cursor)
|
307
|
-
expect(result.first.class).to eq(TwitterAds::Video)
|
308
|
-
expect(result.first.id).to eq(video_id)
|
309
|
-
end
|
310
|
-
|
311
|
-
end
|
312
|
-
|
313
|
-
end
|
314
|
-
|
315
278
|
end
|
data/twitter-ads.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = TwitterAds::VERSION
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.licenses = ['MIT']
|
11
|
-
s.authors = ['
|
11
|
+
s.authors = ['Brandon Black', 'John Babich', 'Jacob Petrie']
|
12
12
|
s.email = ['twitterdev-ads@twitter.com']
|
13
13
|
s.homepage = 'https://github.com/twitterdev/twitter-ruby-ads-sdk'
|
14
14
|
s.description = 'The officially supported Twitter Ads API SDK for Ruby.'
|
metadata
CHANGED
@@ -1,38 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter-ads
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Brandon Black
|
7
8
|
- John Babich
|
8
|
-
-
|
9
|
-
- Juan Shishido
|
9
|
+
- Jacob Petrie
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
|
-
cert_chain:
|
13
|
-
-
|
14
|
-
-----BEGIN CERTIFICATE-----
|
15
|
-
MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRMwEQYDVQQDDAphZHNh
|
16
|
-
cGktZGV2MRcwFQYKCZImiZPyLGQBGRYHdHdpdHRlcjETMBEGCgmSJomT8ixkARkW
|
17
|
-
A2NvbTAeFw0xODAzMjIxNDU1NDNaFw0xOTAzMjIxNDU1NDNaMEMxEzARBgNVBAMM
|
18
|
-
CmFkc2FwaS1kZXYxFzAVBgoJkiaJk/IsZAEZFgd0d2l0dGVyMRMwEQYKCZImiZPy
|
19
|
-
LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvc9MVtVP
|
20
|
-
iFcis6l0AVMhrz6PY2q6phws6rXDVlnfJ6YoCzKVaZQ7/F7rNccgBRm3e1YtfSMS
|
21
|
-
Rbi6utXIyvi5w6f05R8ete2aI1mzocoErsg179ohrp9NCE1kkfX+1LV/HbFPhmcm
|
22
|
-
KjbmBisAhcAz2SHUk+GBq8fbfKj+jv/K0WpsCinZtd38s96dBIiWK/o+evpSCXIo
|
23
|
-
OwCwP+rxj9m3R6ZbyhFmagfMl3bTk8Xw+UZwc1GgCOJwODVqHMV7/ryyX6IY/Wbu
|
24
|
-
Xw7hQ/4+dMs3xumArhfjQG/3ocHLo4jFScXJ0JYY+b1fW7b0EuvTAEoIcUctNz8o
|
25
|
-
R+ptZC3y2GQ2BQIDAQABo38wfTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
|
26
|
-
HQ4EFgQU/NBrOwjh8uJx/JrAN0FA9dy+RsIwIQYDVR0RBBowGIEWYWRzYXBpLWRl
|
27
|
-
dkB0d2l0dGVyLmNvbTAhBgNVHRIEGjAYgRZhZHNhcGktZGV2QHR3aXR0ZXIuY29t
|
28
|
-
MA0GCSqGSIb3DQEBBQUAA4IBAQAHgAKu94Ix68zuH9+sd89YLpj/bQKyrsW/YZMK
|
29
|
-
JOIbklJGn2xzipuOnaiWCnetm4twROdmVqz+eu7DPFpVRuh8yd72/w5xO8GPBihs
|
30
|
-
WiE4Wn2nS83n6szuSHtz+Osuwnpwi+IGcRaUU5k0ql4wzq0ThxfV1JLp1rYhioWn
|
31
|
-
AwnieA4MlAGo5XyxOBSfgWz6J7qsG9iyvbMMSzn81PX0bUz0n0F1W4A+GPnn62/C
|
32
|
-
6/42oM9SP/6CMxevv7dmeQsbzuQWezV1EvcgHn8ITnFH9JXY8ZfDXPVyqvxPjeFH
|
33
|
-
gs09+Abi4upZUoQi8GBp5k0sYT1f3aGIpxtuAJtahWypI+LI
|
34
|
-
-----END CERTIFICATE-----
|
35
|
-
date: 2018-03-22 00:00:00.000000000 Z
|
12
|
+
cert_chain: []
|
13
|
+
date: 2019-02-14 00:00:00.000000000 Z
|
36
14
|
dependencies:
|
37
15
|
- !ruby/object:Gem::Dependency
|
38
16
|
name: multi_json
|
@@ -113,7 +91,6 @@ files:
|
|
113
91
|
- lib/twitter-ads/creative/promoted_account.rb
|
114
92
|
- lib/twitter-ads/creative/promoted_tweet.rb
|
115
93
|
- lib/twitter-ads/creative/scheduled_tweet.rb
|
116
|
-
- lib/twitter-ads/creative/video.rb
|
117
94
|
- lib/twitter-ads/creative/video_app_download_card.rb
|
118
95
|
- lib/twitter-ads/creative/video_conversation_card.rb
|
119
96
|
- lib/twitter-ads/creative/video_website_card.rb
|
@@ -132,6 +109,8 @@ files:
|
|
132
109
|
- lib/twitter-ads/resources/dsl.rb
|
133
110
|
- lib/twitter-ads/resources/persistence.rb
|
134
111
|
- lib/twitter-ads/resources/resource.rb
|
112
|
+
- lib/twitter-ads/settings/tax.rb
|
113
|
+
- lib/twitter-ads/settings/user.rb
|
135
114
|
- lib/twitter-ads/targeting/reach_estimate.rb
|
136
115
|
- lib/twitter-ads/targeting_criteria/app_store_category.rb
|
137
116
|
- lib/twitter-ads/targeting_criteria/behavior.rb
|
@@ -191,8 +170,6 @@ files:
|
|
191
170
|
- spec/twitter-ads/creative/promoted_tweet_spec.rb
|
192
171
|
- spec/twitter-ads/creative/video_app_download_card_spec.rb
|
193
172
|
- spec/twitter-ads/creative/video_conversation_card_spec.rb
|
194
|
-
- spec/twitter-ads/creative/video_legacy_spec.rb
|
195
|
-
- spec/twitter-ads/creative/video_spec.rb
|
196
173
|
- spec/twitter-ads/creative/website_card_spec.rb
|
197
174
|
- spec/twitter-ads/cursor_spec.rb
|
198
175
|
- spec/twitter-ads/http/ton_upload_spec.rb
|
@@ -238,7 +215,6 @@ test_files:
|
|
238
215
|
- spec/twitter-ads/campaign/tweet_spec.rb
|
239
216
|
- spec/twitter-ads/creative/account_media_spec.rb
|
240
217
|
- spec/twitter-ads/creative/website_card_spec.rb
|
241
|
-
- spec/twitter-ads/creative/video_legacy_spec.rb
|
242
218
|
- spec/twitter-ads/creative/video_app_download_card_spec.rb
|
243
219
|
- spec/twitter-ads/creative/media_creative_spec.rb
|
244
220
|
- spec/twitter-ads/creative/promoted_tweet_spec.rb
|
@@ -246,7 +222,6 @@ test_files:
|
|
246
222
|
- spec/twitter-ads/creative/video_conversation_card_spec.rb
|
247
223
|
- spec/twitter-ads/creative/promoted_account_spec.rb
|
248
224
|
- spec/twitter-ads/creative/image_app_download_card_spec.rb
|
249
|
-
- spec/twitter-ads/creative/video_spec.rb
|
250
225
|
- spec/twitter-ads/utils_spec.rb
|
251
226
|
- spec/shared/properties.rb
|
252
227
|
- spec/support/helpers.rb
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Copyright (C) 2015 Twitter, Inc.
|
3
|
-
|
4
|
-
module TwitterAds
|
5
|
-
module Creative
|
6
|
-
|
7
|
-
class Video
|
8
|
-
|
9
|
-
include TwitterAds::DSL
|
10
|
-
include TwitterAds::Resource
|
11
|
-
include TwitterAds::Persistence
|
12
|
-
|
13
|
-
attr_reader :account
|
14
|
-
|
15
|
-
property :aspect_ratio, read_only: true
|
16
|
-
property :created_at, type: :time, read_only: true
|
17
|
-
property :deleted, type: :bool, read_only: true
|
18
|
-
property :duration, read_only: true
|
19
|
-
property :id, read_only: true
|
20
|
-
property :media_key, read_only: true
|
21
|
-
property :poster_url, read_only: true
|
22
|
-
property :preview_url, read_only: true
|
23
|
-
property :ready_to_tweet, type: :bool, read_only: true
|
24
|
-
property :reasons_not_servable, read_only: true
|
25
|
-
property :tweeted, type: :bool, read_only: true
|
26
|
-
property :updated_at, type: :time, read_only: true
|
27
|
-
|
28
|
-
property :description
|
29
|
-
property :poster_image_media_id
|
30
|
-
property :title
|
31
|
-
property :video_media_id
|
32
|
-
|
33
|
-
RESOURCE_COLLECTION = "/#{TwitterAds::API_VERSION}/" +
|
34
|
-
'accounts/%{account_id}/videos'.freeze # @api private
|
35
|
-
RESOURCE = "/#{TwitterAds::API_VERSION}/" +
|
36
|
-
'accounts/%{account_id}/videos/%{id}'.freeze # @api private
|
37
|
-
|
38
|
-
def initialize(account)
|
39
|
-
@account = account
|
40
|
-
self
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# TODO: legacy namespace support, to be removed in v1.0.0 (next major)
|
49
|
-
TwitterAds::Video = TwitterAds::Creative::Video
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Copyright (C) 2015 Twitter, Inc.
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
describe TwitterAds::Video do
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
stub_fixture(:get, :accounts_all, "#{ADS_API}/accounts")
|
10
|
-
stub_fixture(:get, :accounts_load, "#{ADS_API}/accounts/2iqph")
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:client) do
|
14
|
-
Client.new(
|
15
|
-
Faker::Lorem.characters(15),
|
16
|
-
Faker::Lorem.characters(40),
|
17
|
-
"123456-#{Faker::Lorem.characters(40)}",
|
18
|
-
Faker::Lorem.characters(40)
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
let(:account) { client.accounts.first }
|
23
|
-
|
24
|
-
# check model properties
|
25
|
-
subject { described_class.new(account) }
|
26
|
-
|
27
|
-
read = %w(
|
28
|
-
id
|
29
|
-
tweeted
|
30
|
-
ready_to_tweet
|
31
|
-
duration
|
32
|
-
reasons_not_servable
|
33
|
-
preview_url
|
34
|
-
created_at
|
35
|
-
updated_at
|
36
|
-
deleted
|
37
|
-
)
|
38
|
-
|
39
|
-
write = %w(title description video_media_id)
|
40
|
-
|
41
|
-
include_examples 'object property check', read, write
|
42
|
-
|
43
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
# Copyright (C) 2015 Twitter, Inc.
|
3
|
-
|
4
|
-
require 'spec_helper'
|
5
|
-
|
6
|
-
describe TwitterAds::Creative::Video do
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
stub_fixture(:get, :accounts_all, "#{ADS_API}/accounts")
|
10
|
-
stub_fixture(:get, :accounts_load, "#{ADS_API}/accounts/2iqph")
|
11
|
-
end
|
12
|
-
|
13
|
-
let(:client) do
|
14
|
-
Client.new(
|
15
|
-
Faker::Lorem.characters(15),
|
16
|
-
Faker::Lorem.characters(40),
|
17
|
-
"123456-#{Faker::Lorem.characters(40)}",
|
18
|
-
Faker::Lorem.characters(40)
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
let(:account) { client.accounts.first }
|
23
|
-
|
24
|
-
# check model properties
|
25
|
-
subject { described_class.new(account) }
|
26
|
-
|
27
|
-
read = %w(
|
28
|
-
id
|
29
|
-
tweeted
|
30
|
-
ready_to_tweet
|
31
|
-
duration
|
32
|
-
reasons_not_servable
|
33
|
-
preview_url
|
34
|
-
created_at
|
35
|
-
updated_at
|
36
|
-
deleted
|
37
|
-
)
|
38
|
-
|
39
|
-
write = %w(title description video_media_id)
|
40
|
-
|
41
|
-
include_examples 'object property check', read, write
|
42
|
-
|
43
|
-
end
|
metadata.gz.sig
DELETED
Binary file
|