Class: PPC::API::Sm::Phone

Inherits:
PPC::API::Sm show all
Defined in:
lib/ppc/api/sm/phone_new_creative.rb

Constant Summary collapse

Service =
'NewCreative'

Class Method Summary collapse

Methods inherited from PPC::API::Sm

process, request_uri, reverse_type

Methods included from PPC::API

#debug_off, #debug_on, #is_no_quota, #make_type, #process, #request, #request_http_body, #request_http_header, #request_uri, #reverse_type

Class Method Details

.search_id_by_group_id(auth, ids, getTemp = 0) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ppc/api/sm/phone_new_creative.rb', line 24

def self.search_id_by_group_id( auth, ids, getTemp = 0 )
  '''
  \'getPhoneIdByAdgroupId\'
  @ input: group ids
  @ output:  groupPhoneIds
  '''
  ids = [ ids ] unless ids.is_a? Array
  body = { adgroupIds: ids, getTemp: getTemp }
  response = request( auth, Service, 'getPhoneIdByAdgroupId', body )
  process( response, 'groupPhoneIds' ){ |x| make_groupPhoneIds( x ) }
end

.update(auth, phones) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/ppc/api/sm/phone_new_creative.rb', line 15

def self.update( auth, phones )
  '''
  根据实际使用情况,更新的时候creative title为必填选
  '''
  body = { phoneTypes: make_type( phones ) }
  response = request( auth, Service, 'updatePhone', body )
  process( response, 'phoneTypes' ){ |x| reverse_type(x) }
end