Class: AdWords::V201003::CampaignAdExtensionService::CampaignAdExtensionServiceWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/adwords4r/v201003/CampaignAdExtensionServiceWrapper.rb

Overview

Wrapper class for the v201003 CampaignAdExtension service. This class is automatically generated.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, api) ⇒ CampaignAdExtensionServiceWrapper

Constructor for CampaignAdExtensionServiceWrapper.

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

def initialize(driver, api)
  @driver = driver
  @api = api
  @module = AdWords::V201003::CampaignAdExtensionService
end

Instance Attribute Details

#apiObject (readonly)

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



14
15
16
# File 'lib/adwords4r/v201003/CampaignAdExtensionServiceWrapper.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::V201003::CampaignAdExtensionService::ClassName

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



23
24
25
# File 'lib/adwords4r/v201003/CampaignAdExtensionServiceWrapper.rb', line 23

def module
  @module
end

Instance Method Details

#get(selector) ⇒ Object

Calls the get method of the CampaignAdExtension service. Check the online documentation for this method.

Args:

  • selector: AdWords::V201003::CampaignAdExtensionService::CampaignAdExtensionSelector

Returns:

  • rval: AdWords::V201003::CampaignAdExtensionService::CampaignAdExtensionPage

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/v201003/CampaignAdExtensionServiceWrapper.rb', line 52

def get(selector)
  begin
    AdWords::Service.validate_param('selector',
        selector, AdWords::V201003::CampaignAdExtensionService::CampaignAdExtensionSelector)
    # Construct request object and make API call
    obj = AdWords::V201003::CampaignAdExtensionService::Get.new(selector)
    return @driver.get(obj)
  rescue SOAP::FaultError => fault
    raise(AdWords::Error::create_specific_api_error(fault),
        "get Call Failed: " + fault.faultstring.to_s, caller)
  end
end

#mutate(operations) ⇒ Object

Calls the mutate method of the CampaignAdExtension service. Check the online documentation for this method.

Args:

  • operations: SOAP::SOAPArray of AdWords::V201003::CampaignAdExtensionService::CampaignAdExtensionOperation

Returns:

  • rval: AdWords::V201003::CampaignAdExtensionService::CampaignAdExtensionReturnValue

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/v201003/CampaignAdExtensionServiceWrapper.rb', line 77

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