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.
Files changed (92) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +1 -1
  3. data/README.md +3 -4
  4. data/Rakefile +1 -2
  5. data/lib/twitter-ads.rb +10 -11
  6. data/lib/twitter-ads/account.rb +12 -12
  7. data/lib/twitter-ads/audiences/audience_intelligence.rb +3 -3
  8. data/lib/twitter-ads/audiences/tailored_audience.rb +12 -156
  9. data/lib/twitter-ads/campaign/app_list.rb +5 -5
  10. data/lib/twitter-ads/campaign/campaign.rb +7 -11
  11. data/lib/twitter-ads/campaign/funding_instrument.rb +6 -5
  12. data/lib/twitter-ads/campaign/iab_category.rb +2 -2
  13. data/lib/twitter-ads/campaign/line_item.rb +18 -21
  14. data/lib/twitter-ads/campaign/organic_tweet.rb +1 -5
  15. data/lib/twitter-ads/campaign/promotable_user.rb +5 -5
  16. data/lib/twitter-ads/campaign/targeting_criteria.rb +7 -7
  17. data/lib/twitter-ads/campaign/tweet.rb +7 -11
  18. data/lib/twitter-ads/client.rb +3 -4
  19. data/lib/twitter-ads/creative/account_media.rb +5 -5
  20. data/lib/twitter-ads/creative/cards_fetch.rb +8 -6
  21. data/lib/twitter-ads/creative/image_app_download_card.rb +5 -5
  22. data/lib/twitter-ads/creative/image_conversation_card.rb +5 -5
  23. data/lib/twitter-ads/creative/media_creative.rb +6 -5
  24. data/lib/twitter-ads/creative/media_library.rb +5 -5
  25. data/lib/twitter-ads/creative/poll_cards.rb +5 -5
  26. data/lib/twitter-ads/creative/promoted_account.rb +5 -9
  27. data/lib/twitter-ads/creative/promoted_tweet.rb +5 -9
  28. data/lib/twitter-ads/creative/scheduled_tweet.rb +7 -7
  29. data/lib/twitter-ads/creative/tweet_previews.rb +36 -0
  30. data/lib/twitter-ads/creative/video_app_download_card.rb +5 -5
  31. data/lib/twitter-ads/creative/video_conversation_card.rb +5 -5
  32. data/lib/twitter-ads/creative/video_website_card.rb +4 -4
  33. data/lib/twitter-ads/creative/website_card.rb +3 -3
  34. data/lib/twitter-ads/cursor.rb +2 -2
  35. data/lib/twitter-ads/enum.rb +128 -122
  36. data/lib/twitter-ads/error.rb +2 -2
  37. data/lib/twitter-ads/http/request.rb +6 -5
  38. data/lib/twitter-ads/http/response.rb +1 -1
  39. data/lib/twitter-ads/legacy.rb +1 -1
  40. data/lib/twitter-ads/measurement/app_event_tag.rb +3 -3
  41. data/lib/twitter-ads/measurement/web_event_tag.rb +3 -3
  42. data/lib/twitter-ads/resources/analytics.rb +38 -8
  43. data/lib/twitter-ads/resources/batch.rb +4 -4
  44. data/lib/twitter-ads/resources/dsl.rb +1 -1
  45. data/lib/twitter-ads/resources/persistence.rb +1 -1
  46. data/lib/twitter-ads/resources/resource.rb +2 -2
  47. data/lib/twitter-ads/settings/tax.rb +3 -3
  48. data/lib/twitter-ads/settings/user.rb +3 -3
  49. data/lib/twitter-ads/targeting/reach_estimate.rb +1 -1
  50. data/lib/twitter-ads/targeting_criteria/app_store_category.rb +3 -3
  51. data/lib/twitter-ads/targeting_criteria/behavior.rb +3 -3
  52. data/lib/twitter-ads/targeting_criteria/behavior_taxonomy.rb +3 -3
  53. data/lib/twitter-ads/targeting_criteria/device.rb +3 -3
  54. data/lib/twitter-ads/targeting_criteria/event.rb +3 -3
  55. data/lib/twitter-ads/targeting_criteria/interest.rb +3 -3
  56. data/lib/twitter-ads/targeting_criteria/language.rb +3 -3
  57. data/lib/twitter-ads/targeting_criteria/location.rb +3 -3
  58. data/lib/twitter-ads/targeting_criteria/network_operator.rb +3 -3
  59. data/lib/twitter-ads/targeting_criteria/platform.rb +3 -3
  60. data/lib/twitter-ads/targeting_criteria/platform_version.rb +3 -3
  61. data/lib/twitter-ads/targeting_criteria/tv_market.rb +3 -3
  62. data/lib/twitter-ads/targeting_criteria/tv_show.rb +3 -3
  63. data/lib/twitter-ads/utils.rb +2 -2
  64. data/lib/twitter-ads/version.rb +2 -2
  65. data/spec/quality_spec.rb +2 -2
  66. data/spec/shared/properties.rb +1 -1
  67. data/spec/spec_helper.rb +9 -8
  68. data/spec/support/helpers.rb +1 -1
  69. data/spec/twitter-ads/account_spec.rb +1 -1
  70. data/spec/twitter-ads/audiences/tailored_audience_spec.rb +1 -1
  71. data/spec/twitter-ads/campaign/app_list_spec.rb +1 -1
  72. data/spec/twitter-ads/campaign/line_item_spec.rb +1 -1
  73. data/spec/twitter-ads/campaign/reach_estimate_spec.rb +1 -1
  74. data/spec/twitter-ads/campaign/targeting_criteria_spec.rb +1 -1
  75. data/spec/twitter-ads/campaign/tweet_spec.rb +1 -1
  76. data/spec/twitter-ads/client_spec.rb +1 -1
  77. data/spec/twitter-ads/creative/account_media_spec.rb +1 -1
  78. data/spec/twitter-ads/creative/image_app_download_card_spec.rb +1 -1
  79. data/spec/twitter-ads/creative/image_conversation_card_spec.rb +1 -1
  80. data/spec/twitter-ads/creative/media_creative_spec.rb +1 -1
  81. data/spec/twitter-ads/creative/promoted_account_spec.rb +1 -1
  82. data/spec/twitter-ads/creative/promoted_tweet_spec.rb +1 -1
  83. data/spec/twitter-ads/creative/video_app_download_card_spec.rb +1 -1
  84. data/spec/twitter-ads/creative/video_conversation_card_spec.rb +1 -1
  85. data/spec/twitter-ads/creative/website_card_spec.rb +1 -1
  86. data/spec/twitter-ads/cursor_spec.rb +1 -1
  87. data/spec/twitter-ads/placements_spec.rb +1 -1
  88. data/spec/twitter-ads/utils_spec.rb +1 -1
  89. data/twitter-ads.gemspec +10 -6
  90. metadata +10 -25
  91. data/lib/twitter-ads/http/ton_upload.rb +0 -156
  92. data/spec/twitter-ads/http/ton_upload_spec.rb +0 -96
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
- # Copyright (C) 2015 Twitter, Inc.
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'.freeze # @api private
29
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
30
- 'accounts/%{account_id}/funding_instruments/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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".freeze # @api private
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) 2015 Twitter, Inc.
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 :entity_status
33
+ property :placements
29
34
  property :primary_web_event_tag
30
35
  property :product_type
31
- property :placements
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'.freeze # @api private
49
- RESOURCE_STATS = "/#{TwitterAds::API_VERSION}/" +
50
- 'stats/accounts/%{account_id}'.freeze # @api private
51
- RESOURCE_ASYNC_STATS = "/#{TwitterAds::API_VERSION}/" +
52
- 'stats/jobs/accounts/%{account_id}'.freeze # @api private
53
- RESOURCE_BATCH = "/#{TwitterAds::API_VERSION}/" +
54
- 'batch/accounts/%{account_id}/line_items'.freeze # @api private
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) 2015 Twitter, Inc.
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) 2015 Twitter, Inc.
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'.freeze # @api private
21
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
22
- 'accounts/%{account_id}/promotable_users/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
33
- RESOURCE_BATCH = "/#{TwitterAds::API_VERSION}/" +
34
- 'batch/accounts/%{account_id}/targeting_criteria'.freeze # @api private
35
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
36
- 'accounts/%{account_id}/targeting_criteria/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
12
- RESOURCE_STATS = "/#{TwitterAds::API_VERSION}/" +
13
- 'stats/accounts/%{account_id}'.freeze # @api private
14
- RESOURCE_ASYNC_STATS = "/#{TwitterAds::API_VERSION}/" +
15
- 'stats/jobs/accounts/%{account_id}'.freeze # @api private
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
 
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
- # Copyright (C) 2015 Twitter, Inc.
2
+ # Copyright (C) 2019 Twitter, Inc.
3
3
 
4
4
  module TwitterAds
5
5
 
6
- API_VERSION = '5'.freeze
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) 2015 Twitter, Inc.
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'.freeze # @api private
27
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
28
- 'accounts/%{account_id}/account_media/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
75
+ 'accounts/%{account_id}/cards/all' # @api private
76
76
  FETCH_ID = "/#{TwitterAds::API_VERSION}/" +
77
- 'accounts/%{account_id}/cards/all/%{id}'.freeze # @api private
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!(opts)
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!(opts).merge!(params)
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!(opts).merge!(params)
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) 2015 Twitter, Inc.
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'.freeze # @api private
38
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
39
- 'accounts/%{account_id}/cards/image_app_download/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
40
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
41
- 'accounts/%{account_id}/cards/image_conversation/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
28
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
29
- 'accounts/%{account_id}/media_creatives/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
40
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
41
- 'accounts/%{account_id}/media_library/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
45
- RESOURCE = "/#{TwitterAds::API_VERSION}/" +
46
- 'accounts/%{account_id}/cards/poll/%{id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
28
- RESOURCE_STATS = "/#{TwitterAds::API_VERSION}/" +
29
- 'stats/accounts/%{account_id}'.freeze # @api private
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) 2015 Twitter, Inc.
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'.freeze # @api private
28
- RESOURCE_STATS = "/#{TwitterAds::API_VERSION}/" +
29
- 'stats/accounts/%{account_id}'.freeze # @api private
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