Sha256: aed876f0818c8d5c609067939bbef57254c499d1d1b0f1f5380e0ffd23a78805

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

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

        @map = [
                [:id,:accountid],            
                [:balance,:balance],         
                [:cost,:totalCost],               
                [:payment,:totalPay],                          
                [:budget_type,:type],                   
                [:budget,:budget],                              
                [:region,:regions],                    
                [:exclude_ip,:excludeIps],                        
                [:open_domains,:domains],                  
                [:offline_time,:budgetOfflineTime],         
                [:opt,:opt]                                  
              ]

        def self.info(auth, debug = false)
          response = request(auth,Service,'getAccountInfo'  )
          return process( response, 'accountInfoType', debug ){ |x|reverse_type(x)[0] }
        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)[0] }
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ppc-0.3.0 lib/ppc/api/sogou/account.rb