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 Google::Ads::AdWords::Utilities::BatchJobHandlerStatus. 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

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 Google::Ads::AdWords::Utilities::BatchJobHandlerStatus. Keep track of this status as you will need to pass it in to the next request as the $status. 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 current Google::Ads::AdWords::Utilities::BatchJobHandlerStatus. In the first request, this object must be initialized with the URL to which the operations will be uploaded. For any uploads following the first upload, pass in the Google::Ads::AdWords::Utilities::BatchJobHandlerStatus from the previous upload.

  • 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

Returns

This returns Google::Ads::AdWords::Utilities::BatchJobHandlerStatus 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.