Sha256: 50e8783241f849347900bfcb2c154d4b2547e9892795672a488058c7cf03d357

Contents?: true

Size: 1.82 KB

Versions: 3

Compression:

Stored size: 1.82 KB

Contents

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

        AccountInfoType = {
          id:                   :userId,
          balance:              :balance,
          pc_balance:           :pcBalance,
          mobile_balance:       :mobileBalance,
          cost:                 :cost,
          payment:              :payment,
          status:               :userStat,
          budget_type:          :budgetType,
          budget:               :budget,
          region:               :regionTarget,
          exclude_ip:           :excludeIp,
          isdynamic:            :isDynamicCreative,
          isdynamictagsublink:  :isDynamicTagSublink,
          isdynamichotredirect: :isDynamicHotRedirect,
          isdynamictitle:       :isDynamicTitle,
          dynamic_param:        :dynamicCreativeParam,
          open_domains:         :openDomains,
          reg_domain:           :regDomain,
          offline_time:         :budgetOfflineTime,
          weekly_budget:        :weeklyBudget,
          user_level:           :userLevel,
        }
        @map = AccountInfoType

        def self.info( auth )
          body = {:accountFields => AccountInfoType.values}
          response = request(auth,Service,'getAccountInfo',body)
          process( response, 'accountInfoType' ){ |x|reverse_type(x)[0] }
        end

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

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ppc-2.0.5 lib/ppc/api/baidu/account.rb
ppc-2.0.4 lib/ppc/api/baidu/account.rb
ppc-2.0.3 lib/ppc/api/baidu/account.rb