Class: AdWords::V13::TrafficEstimatorService::TrafficEstimatorServiceWrapper

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, api) ⇒ TrafficEstimatorServiceWrapper

Constructor for TrafficEstimatorServiceWrapper.

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/TrafficEstimatorServiceWrapper.rb', line 34

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

Instance Attribute Details

#apiObject (readonly)

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



14
15
16
# File 'lib/adwords4r/v13/TrafficEstimatorServiceWrapper.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::TrafficEstimatorService::ClassName

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



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

def module
  @module
end

Instance Method Details

#checkKeywordTraffic(requests) ⇒ Object

Calls the checkKeywordTraffic method of the TrafficEstimator service. Check the online documentation for this method.

Args:

  • requests: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::KeywordTrafficRequest

Returns:

  • checkKeywordTrafficReturn: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::KeywordTraffic

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



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/adwords4r/v13/TrafficEstimatorServiceWrapper.rb', line 52

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

#estimateAdGroupList(adGroupRequests) ⇒ Object

Calls the estimateAdGroupList method of the TrafficEstimator service. Check the online documentation for this method.

Args:

  • adGroupRequests: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::AdGroupRequest

Returns:

  • estimateAdGroupListReturn: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::AdGroupEstimate

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



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/adwords4r/v13/TrafficEstimatorServiceWrapper.rb', line 77

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

#estimateCampaignList(campaignRequests) ⇒ Object

Calls the estimateCampaignList method of the TrafficEstimator service. Check the online documentation for this method.

Args:

  • campaignRequests: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::CampaignRequest

Returns:

  • estimateCampaignListReturn: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::CampaignEstimate

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



102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/adwords4r/v13/TrafficEstimatorServiceWrapper.rb', line 102

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

#estimateKeywordList(keywordRequests) ⇒ Object

Calls the estimateKeywordList method of the TrafficEstimator service. Check the online documentation for this method.

Args:

  • keywordRequests: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::KeywordRequest

Returns:

  • estimateKeywordListReturn: SOAP::SOAPArray of AdWords::V13::TrafficEstimatorService::KeywordEstimate

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



127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/adwords4r/v13/TrafficEstimatorServiceWrapper.rb', line 127

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