The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Google::Ads::AdWords::Utilities::BatchJobHandler

DESCRIPTION

Processes batch job requests through the AdWords API.

PROPERTIES

The following properties may be accessed using get_PROPERTY methods:

  • client

    A reference to a Google::Ads::AdWords::Client.

METHODS

new

Constructor. The following data structure may be passed to new():

 { # Google::Ads::AdWords::Utilities::BatchJobHandler
   client =>  $client, # A ref to a Google::Ads::AdWords::Client object
 },

METHODS

upload_operations

Upload a list of operations. Returns the result contents as a string. If the request fails this returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError.

Parameters

  • An array of operations to be uploaded to the upload URL.

  • A URL to which to upload (POST) the operations.

  • The timeout is an optional parameter that can be set to alter the default time that the http client waits to get a response from the server. If the timeout is not specified, the default is Google::Ads::AdWords::Constants::LWP_DEFAULT_TIMEOUT

    = back

Returns

The contents of the HTTP response as a string if the request is successful. Otherwise, this returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError.

Exceptions

Returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError if the batch job fails immediately.

upload_incremental_operations

Upload a list of operations incrementally. Send operations to the upload URL as the operations are available. The operations will not be executed until the boolean is set indicating that it's the last request. This returns the current total number of uploaded bytes. Keep track of this number as you will need to pass it in to the next request as the $total_content_length. If the request fails this returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError.

Parameters

  • An array of operations to be uploaded to the upload URL.

  • The number of bytes that have been uploaded already in total. If not specified, this defaults to zero.

  • If this is the last request to be uploadeed, set the value to true. False values are: 0, '0', '', (), or undef True values are anything other than the false values e.g. 1

  • A URL to which to upload (POST) the operations.

  • The timeout is an optional parameter that can be set to alter the default time that the http client waits to get a response from the server. If the timeout is not specified, the default is Google::Ads::AdWords::Constants::LWP_DEFAULT_TIMEOUT

    = back

Returns

This returns the current total number of bytes already uploaded if the request is successful. Otherwise, this returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError.

Exceptions

Returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError if the batch job fails immediately.

download_response

Returns an object containing the result of the batch job. This is retrieved via the download URL provided in the batch job. On failure, a BatchJobHandlerError will be returned.

Parameters

  • A URL from which to download (GET) the result of processing the operations.

  • The timeout is an optional parameter that can be set to alter the default time that the http client waits to get a response from the server. If the timeout is not specified, the default is Google::Ads::AdWords::Constants::LWP_DEFAULT_TIMEOUT

Returns

BatchJobOpsService::mutateResponse object with contents from the job's download URL

Exceptions

Returns a Google::Ads::AdWords::Utilities::BatchJobHandlerError if the batch job fails immediately.

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 417:

You forgot a '=back' before '=head3'

Around line 471:

You forgot a '=back' before '=head3'

Around line 503:

You forgot a '=back' before '=head3'