Class: AdWords::V13::AccountService::AccountServiceWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/adwords4r/v13/AccountServiceWrapper.rb

Overview

Wrapper class for the v13 Account service. This class is automatically generated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, api) ⇒ AccountServiceWrapper

Constructor for AccountServiceWrapper.

Args:

  • driver: SOAP::RPC::Driver object with the remote SOAP methods for this service

  • api: the AdWords::API object to which the wrapper belongs



34
35
36
37
38
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 34

def initialize(driver, api)
  @driver = driver
  @api = api
  @module = AdWords::V13::AccountService
end

Instance Attribute Details

#apiObject (readonly)

Holds the AdWords::API object to which the wrapper belongs.



14
15
16
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 14

def api
  @api
end

#moduleObject (readonly)

Holds a shortcut to the parent module. Use this to avoid typing the full class name when creating classes belonging to this service, e.g.

service_object.module::ClassName

instead of

AdWords::V13::AccountService::ClassName

This will make it easier to migrate your code between API versions.



23
24
25
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 23

def module
  @module
end

Instance Method Details

#getAccountInfoObject

Calls the getAccountInfo method of the Account service. Check the online documentation for this method.

Returns:

  • getAccountInfoReturn: AdWords::V13::AccountService::AccountInfo

Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.



49
50
51
52
53
54
55
56
57
58
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 49

def getAccountInfo()
  begin
    # Construct request object and make API call
    obj = AdWords::V13::AccountService::GetAccountInfo.new()
    return @driver.getAccountInfo(obj)
  rescue SOAP::FaultError => fault
    raise(AdWords::Error::create_specific_api_error(fault),
        "getAccountInfo Call Failed: " + fault.faultstring.to_s, caller)
  end
end

#getClientAccountInfosObject

Calls the getClientAccountInfos method of the Account service. Check the online documentation for this method.

Returns:

  • getClientAccountInfosReturn: SOAP::SOAPArray of AdWords::V13::AccountService::ClientAccountInfo

Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.



69
70
71
72
73
74
75
76
77
78
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 69

def getClientAccountInfos()
  begin
    # Construct request object and make API call
    obj = AdWords::V13::AccountService::GetClientAccountInfos.new()
    return @driver.getClientAccountInfos(obj)
  rescue SOAP::FaultError => fault
    raise(AdWords::Error::create_specific_api_error(fault),
        "getClientAccountInfos Call Failed: " + fault.faultstring.to_s, caller)
  end
end

#getClientAccountsObject

Calls the getClientAccounts method of the Account service. Check the online documentation for this method.

Returns:

  • getClientAccountsReturn: SOAP::SOAPArray of SOAP::SOAPString

Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.



89
90
91
92
93
94
95
96
97
98
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 89

def getClientAccounts()
  begin
    # Construct request object and make API call
    obj = AdWords::V13::AccountService::GetClientAccounts.new()
    return @driver.getClientAccounts(obj)
  rescue SOAP::FaultError => fault
    raise(AdWords::Error::create_specific_api_error(fault),
        "getClientAccounts Call Failed: " + fault.faultstring.to_s, caller)
  end
end

#getMccAlertsObject

Calls the getMccAlerts method of the Account service. Check the online documentation for this method.

Returns:

  • getMccAlertsReturn: SOAP::SOAPArray of AdWords::V13::AccountService::MccAlert

Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.



109
110
111
112
113
114
115
116
117
118
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 109

def getMccAlerts()
  begin
    # Construct request object and make API call
    obj = AdWords::V13::AccountService::GetMccAlerts.new()
    return @driver.getMccAlerts(obj)
  rescue SOAP::FaultError => fault
    raise(AdWords::Error::create_specific_api_error(fault),
        "getMccAlerts Call Failed: " + fault.faultstring.to_s, caller)
  end
end

#updateAccountInfo(accountInfo) ⇒ Object

Calls the updateAccountInfo method of the Account service. Check the online documentation for this method.

Args:

  • accountInfo: AdWords::V13::AccountService::AccountInfo

Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.



129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/adwords4r/v13/AccountServiceWrapper.rb', line 129

def updateAccountInfo(accountInfo)
  begin
    AdWords::Service.validate_param('accountInfo',
        accountInfo, AdWords::V13::AccountService::AccountInfo)
    # Construct request object and make API call
    obj = AdWords::V13::AccountService::UpdateAccountInfo.new(accountInfo)
    return @driver.updateAccountInfo(obj)
  rescue SOAP::FaultError => fault
    raise(AdWords::Error::create_specific_api_error(fault),
        "updateAccountInfo Call Failed: " + fault.faultstring.to_s, caller)
  end
end