Sha256: dd0996c2622b938bac691981ec2595226b630b480f986589dbdc2a9dd6a67ff7

Contents?: true

Size: 1.94 KB

Versions: 1

Compression:

Stored size: 1.94 KB

Contents

module PPC
  module API
    class Baidu
      class Account< Baidu
        Service = 'Account'

        @map = [
                          [:id,:userid],            
                          [:balance,:balance],         
                          [:cost,:cost],               
                          [:payment,:payment],                          
                          [:status,:userStat],                            
                          [:budget_type,:budgetType],                   
                          [:budget,:budget],                              
                          [:region,:regionTarget],                    
                          [:exclude_ip,:excludeIp],                        
                          [:isdynamic,:isDynamicCreative],         
                          [:dynamic_param,:dynamicCreativeParam], 
                          [:open_domains,:openDomains],                  
                          [:reg_domain,:regDomain],                       
                          [:offline_time,:budgetOfflineTime],         
                          [:weekly_budget,:weeklyBudget],                
                          [:opt,:opt]                                  
                        ]

        def self.info(auth, debug = false)
          response = request(auth,Service,'getAccountInfo'  )
          return process( response, 'accountInfoType', debug ){ |x|reverse_type(x) }
        end

        def self.update(auth, param = {}, debug = false)
          """
          update account info
          @ params : account_info_type
          @return : account info_type
          """
          # for account service, there is not bulk operation
          infoType = make_type( param )[0]
          body = { accountInfoType: infoType }
          response = request(auth,Service,'updateAccountInfo', body)
          return process( response, 'accountInfoType', debug ){ |x|reverse_type(x) }
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ppc-1.3.0 lib/ppc/api/baidu/account.rb