Class: Adparlor::Facebook::GraphApi::CustomAudienceUser

Inherits:
GraphObject
  • Object
show all
Includes:
Fields::CustomAudienceUser, Traits::Methods
Defined in:
lib/adparlor/facebook/graph_api/custom_audience_user.rb

Constant Summary collapse

FIELD_KEYS =
{
  emails: 'EMAIL_SHA256',
  phone_numbers: 'PHONE_SHA256',
  facebook_uids: 'UID',
  mobile_adversiter_ids: 'MOBILE_ADVERTISER_ID',
  genders: ['GEN'],
  first_names: ['FN'],
  last_name: ['LN'],
  cities: ['CT'],
  states: ['ST'],
  zip_codes: ['ZIP'],
  mobile_device_ids: ['MADID']
}

Constants included from Fields::CustomAudienceUser

Fields::CustomAudienceUser::FIELDS, Fields::CustomAudienceUser::UPDATE_FIELDS

Constants included from Fields::FieldDecorator

Fields::FieldDecorator::GLOBAL_FIELDS

Instance Attribute Summary

Attributes inherited from GraphObject

#access_token

Instance Method Summary collapse

Methods included from Traits::Methods

#create, included

Methods inherited from GraphObject

#batch, create, #create, data_pass_through, destroy, get, #initialize, parse_data_for_collection, read, respond_for_data, #to_hash, #to_json, update

Methods included from Api

#base_uri, #conn, #conn_multi, #delete, #get, #post, #proxy_api_key

Methods included from Fields::FieldDecorator

included

Constructor Details

This class inherits a constructor from Adparlor::Facebook::GraphApi::GraphObject

Instance Method Details

#destroy(path, options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/adparlor/facebook/graph_api/custom_audience_user.rb', line 24

def destroy(path, options = {})
  if @custom_audience_id
    destroy_path = "/#{custom_audience_id}/users"
  else
    raise FbError.new('required parameter account_id missing', 500) unless @account_id
     = remove_instance_variable(:@account_id)
    destroy_path = "act_#{}/usersofanyaudience"
  end
  ready_payload
  super(destroy_path, options)
end

#pathObject

Raises:



36
37
38
39
# File 'lib/adparlor/facebook/graph_api/custom_audience_user.rb', line 36

def path
  raise FbError.new('required parameter custom_audience_id missing', 500) unless custom_audience_id
  "/#{custom_audience_id}/users"
end

#update(path, options = {}) ⇒ Object



41
42
43
44
# File 'lib/adparlor/facebook/graph_api/custom_audience_user.rb', line 41

def update(path, options = {})
  ready_payload
  super(path, options)
end