NAME

Google::Adwords::InfoService - Interact with the Google Adwords InfoService API calls

VERSION

This documentation refers to Google::Adwords::InfoService version 0.2

SYNOPSIS

    use Google::Adwords::InfoService;

    my $ginfo = Google::Adwords::InfoService->new();

    $ginfo->email('email@domain.com')
          ->password('password')
          ->developerToken('developer_token')
          ->applicationToken('application_token');

    # If you use a MCC
    $ginfo->clientEmail('clientemail@domain.com');

    my $quota = $ginfo->getFreeUsageQuotaThisMonth;
    print "Free quota this month is $quota\n"; 

    my $operations_count = $ginfo->getOperationCount({
        startDate => $start_date,
        endDate => $end_date,
    });
    print "Number of operations: $operations_count\n";

  

METHODS

getUsageQuotaThisMonth()

Description

    Retrieves this month's total usage quota, including free quota usage, or the developer token being used to make this call.

Usage

        my $quota = $ginfo->getUsageQuotaThisMonth();

Parameters

    NONE

Returns

    $quota - A number

getFreeUsageQuotaThisMonth()

Description

    Designed specifically for AdWords Commercial Developer Program participants. Retrieves this month's free usage quota for the developer token being used to make this call. For those not enrolled in the AdWords Commercial Developer Program, this value will be identical to that returned for getUsageQuotaThisMonth.

Usage

        my $quota = $ginfo->getFreeUsageQuotaThisMonth();

Parameters

    NONE

Returns

    $quota - A number

getMethodCost()

Description

    Retrieves the cost, in quota units per operation, of the given method on a specific date. Methods default to a cost of 1.

Usage

        my $cost = $ginfo->getMethodCost({
            service => $service_name,
            method => $method_name,
            date => $date,
        });

Parameters

    A hashref with keys:

    * service - The name of the service containing the method, for example, "ReportService".

    * method - The method whose quota cost is being queried, for example "scheduleReportJob".

    * date - The date for which to retrieve the cost of the method. An error occurs if this date is in the future. Format is YYYY-MM-DD

Returns

    $cost - the cost, in quota units per operation

getOperationCount()

Description

    Retrieves the number of operations recorded for the developer token being used to make this call over the given date range. The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the operation count for a single day, supply it as both the start and end date.

Usage

        my $count = $ginfo->getOperationCount({
            startDate => $date,
            endDate => $date,
        });

Parameters

    A hashref with keys:

    * startDate - the beginning of the date range, inclusive. YYYY-MM-DD format.

    * ebdDate - the end of the date range, inclusive. YYYY-MM-DD format.

Returns

    $count - the number of operations recorded in the given date range

getUnitCount()

Description

    Retrieves the number of quota units recorded for the developer token being used to make this call over the given date range. The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the unit count for a single day, supply it as both the start and end date.

Usage

        my $count = $ginfo->getUnitCount({
            startDate => $date,
            endDate => $date,
        });

Parameters

    A hashref, with keys:

    * startDate - the beginning of the date range, inclusive. YYYY-MM-DD format.

    * endDate - the end of the date range, inclusive. YYYY-MM-DD format.

Returns

    $count - the number of quota units recorded over the given date range

getUnitCountForMethod()

Description

    Retrieves the number of quota units recorded for the developer token being used to make this call over the given date range for a specific method. The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the unit count for a single day, supply it as both the start and end date.

Usage

        my $count = $ginfo->getUnitCountForMethod({
            service => $service_name,
            method => $method_name,
            startDate => $date,
            endDate => $date,
        });

Parameters

    A hashref, with keys:

    * service - The name of the service containing the method, for example, "ReportService".

    * method - The method whose quota cost is being queried, for example "scheduleReportJob".

    * startDate - the beginning of the date range, inclusive. YYYY-MM-DD format.

    * endDate - the end of the date range, inclusive. YYYY-MM-DD format.

Returns

    $count - the number of quota units recorded over the given date range

getUnitCountForClients()

Description

    Retrieves the number of quota units recorded for a subset of clients over the given date range. The time zone is implicitly assumed to be Pacific time (PST or PDT). The given dates are inclusive; to get the unit count for a single day, supply it as both the start and end date.

Usage

        my @usage_records = $ginfo->getUnitCountForClients({
            clientEmails => [ $emai1, $email2 ],
            startDate => $date,
            endDate => $date,
        });

Parameters

    A hashref, with keys:

    * clientEmails => arrayref of client emails

    * startDate - the beginning of the date range, inclusive. YYYY-MM-DD format.

    * endDate - the end of the date range, inclusive. YYYY-MM-DD format.

Returns

    @usage_records => A list of Google::Adwords::ClientUsageRecord objects

AUTHOR

Rohan Almeida <rohan@almeida.in>

LICENSE AND COPYRIGHT

Copyright (c) 2006 Rohan Almeida <rohan@almeida.in>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.