Wrapper class for the v201003 Media service. This class is automatically generated.
[R] | api | Holds the AdWords::API object to which the wrapper belongs. |
[R] | module | 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::MediaService::ClassName This will make it easier to migrate your code between API versions. |
Constructor for MediaServiceWrapper.
Args:
- driver: SOAP::RPC::Driver object with the remote SOAP methods for this service
- api: the AdWords::API object to which the wrapper belongs
Source: show
# File lib/adwords4r/v201003/MediaServiceWrapper.rb, line 34 def initialize(driver, api) @driver = driver @api = api @module = AdWords::V201003::MediaService end
Calls the get method of the Media service. Check the online documentation for this method.
Args:
Returns:
Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.
Source: show
# File lib/adwords4r/v201003/MediaServiceWrapper.rb, line 52 def get(selector) begin AdWords::Service.validate_param('selector', selector, AdWords::V201003::MediaService::MediaSelector) # Construct request object and make API call obj = AdWords::V201003::MediaService::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
Calls the upload method of the Media service. Check the online documentation for this method.
Args:
- media: SOAP::SOAPArray of AdWords::V201003::MediaService::Media
Returns:
- rval: SOAP::SOAPArray of AdWords::V201003::MediaService::Media
Raises: Error::ApiError (or a subclass thereof) if a SOAP fault occurs.
Source: show
# File lib/adwords4r/v201003/MediaServiceWrapper.rb, line 77 def upload(media) begin AdWords::Service.validate_param('media', media, SOAP::SOAPArray) # Construct request object and make API call obj = AdWords::V201003::MediaService::Upload.new(media) return @driver.upload(obj) rescue SOAP::FaultError => fault raise(AdWords::Error::create_specific_api_error(fault), "upload Call Failed: " + fault.faultstring.to_s, caller) end end