Class: PPC::API::Sm::Account

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

Constant Summary collapse

Service =
'account'

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

.info(auth) ⇒ Object



22
23
24
25
26
# File 'lib/ppc/api/sm/account.rb', line 22

def self.info( auth )
  response = request(auth, Service, 'getAccount', {requestData: ["account_all"]})
  p response
  return process( response, 'accountInfoType' ){ |x|reverse_type(x)[0] }
end

.update(auth, param = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/ppc/api/sm/account.rb', line 28

def self.update(auth, param = {} )
  """
  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, 'updateAccount', body)
  return process( response, 'accountInfoType' ){ |x|reverse_type(x)[0] }
end