class TwitterAds::AppList

Constants

RESOURCE
RESOURCE_COLLECTION

Attributes

account[R]

Public Class Methods

new(account) click to toggle source
# File lib/twitter-ads/campaign/app_list.rb, line 21
def initialize(account)
  @account = account
  self
end

Public Instance Methods

apps() click to toggle source
# File lib/twitter-ads/campaign/app_list.rb, line 39
def apps
  reload! if @id && !@apps
  @apps
end
create(name, *ids) click to toggle source

Creates a new App List

@param name [String] The name for the app list to be created. @param ids [String] String or String Array of app IDs.

@return [self] Returns the instance refreshed from the API

# File lib/twitter-ads/campaign/app_list.rb, line 32
def create(name, *ids)
  resource = self.class::RESOURCE_COLLECTION % { account_id: account.id }
  params = to_params.merge!(app_store_identifiers: ids.join(','), name: name)
  response = Request.new(account.client, :post, resource, params: params).perform
  from_response(response.body[:data])
end