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'
PhoneType =
{
  id:         :phoneId,
  group_id:   :adgroupId,
  phone_num:  :phoneNum,
  pause:      :pause,
}

Class Method Summary collapse

Methods inherited from PPC::API::Sm

process, request_uri

Methods included from PPC::API

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

Class Method Details

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



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

def self.ids( 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



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

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