Google::Adwords::Service - Base class for the Service modules


Google-Adwords documentation  | view source Contained in the Google-Adwords distribution.

Index


NAME

Top

Google::Adwords::Service - Base class for the Service modules

VERSION

Top

This documentation refers to Google::Adwords::Service version 0.16

DESCRIPTION

Top

This module is not supposed to be used directly. Use the child Service modules. See the Google::Adwords documentation for the list of available child Service modules.

METHODS

Top

These accessors/methods are available across all the child Service modules

new()

Description

    Creates a new Google::Adwords::*Service object

Usage

    my $service = Google::Adwords::CampaignService->new();

Parameters

    NONE

Returns

    A Google::Adwords::*Service object

email()

    Set your Google Adwords account name (your email address). This 
    value should be set before calling any other API methods

password()

    Set your Google Adwords account password. This 
    value should be set before calling any other API methods

developerToken()

    Set your Google Adwords developer token. This 
    value should be set before calling any other API methods

applicationToken()

    Set your Google Adwords application token. This 
    value should be set before calling any other API methods

clientEmail()

    Use this if you have a MCC (My Client Center) account. Set the actual
    client email which will be used for the API calls.

clientCustomerId()

    Use this if you have a MCC (My Client Center) account. Set the actual
    client customerid which will be used for the API calls.
    One of clientEmail and clientCustomerId must be set but NOT both.

useragent()

    Set this to an arbitrary string that identifies the customer sending the
    request. Default value is "Google::Adwords $VERSION"

api_version()

    The Adwords API version you want to use. In format 'v*'. So, to use 
    version 7 of the API, set this to a value of 'v7'. Default value is 'v9'.

use_sandbox()

    If you do $obj->use_sandbox(1), then this module will use the 
    sandbox for all API calls. 

timeout()

    Set the SOAP timeout value in seconds. Default value is 35 seconds.

debug()

    Use $obj->debug(1) if you want to trace the request/response XML

api_version()

    Returns version information for the Adwords API

factory_class_hook()

Specifies a reference to a subroutine. The subroutine will be called whenever the service is about to create a new object. It can be used to alter the class into which new objects are blessed. Default is undef.

The subroutine is passed the default class name, and a reference to the hash of values that will be used to initialise the object. It should return the class name it wishes to use. The class name returned should be a subclass of the original class. If it returns false, the original class name will be used.

For example:

  $service->factory_class_hook( sub {
      my $class_name = shift;
      # only alter Campaign objects
      return unless $class_name eq 'Google::Adwords::Campaign';
      return "My::Adwords::WhizzoCampaign";
  } );




The following accessors are available after an API call is done. These give information about the response

requestId()

Get the unique ID that identifies this request.

operations()

number of operations in the request

units()

number of quota units the request used

responseTime()

elapsed time between the web service receiving the request and sending the response

DEPENDENCIES

Top

* SOAP::Lite
* Class::Accessor::Chained

AUTHOR

Top

Rohan Almeida <rohan@almeida.in>

LICENSE AND COPYRIGHT

Top


Google-Adwords documentation  | view source Contained in the Google-Adwords distribution.