public class BatchJobHelper extends Object implements BatchJobHelperInterface<com.google.api.ads.adwords.jaxws.v201806.cm.Operation,com.google.api.ads.adwords.jaxws.v201806.cm.Operand,com.google.api.ads.adwords.jaxws.v201806.cm.ApiError,MutateResult,BatchJobMutateResponse>
BatchJobHelperInterface
for JAX-WS v201806.Constructor and Description |
---|
BatchJobHelper(AdWordsSession session) |
Modifier and Type | Method and Description |
---|---|
BatchJobMutateResponse |
downloadBatchJobMutateResponse(String downloadUrl)
Downloads and returns the results from the attempted operations for a completed batch job.
|
BatchJobMutateResponse |
downloadBatchJobMutateResponse(String downloadUrl,
int startIndex,
int numberResults)
Downloads and returns a chunk of results from the attempted operations for a completed batch
job.
|
BatchJobUploadResponse |
uploadBatchJobOperations(Iterable<com.google.api.ads.adwords.jaxws.v201806.cm.Operation> operations,
String uploadUrl)
Uploads the specified operations to the batch job.
|
BatchJobUploadResponse |
uploadIncrementalBatchJobOperations(Iterable<? extends com.google.api.ads.adwords.jaxws.v201806.cm.Operation> operations,
boolean isLastRequest,
BatchJobUploadStatus batchJobUploadStatus)
Uploads the specified operations to the batch job.
|
public BatchJobHelper(AdWordsSession session)
public BatchJobUploadResponse uploadBatchJobOperations(Iterable<com.google.api.ads.adwords.jaxws.v201806.cm.Operation> operations, String uploadUrl) throws BatchJobException
BatchJobHelperInterface
ACTIVE
state.
Use this method if you want to upload all operations in a single request. To upload
operations across multiple requests, use BatchJobHelperInterface.uploadIncrementalBatchJobOperations(Iterable,
boolean, BatchJobUploadStatus)
instead.
uploadBatchJobOperations
in interface BatchJobHelperInterface<com.google.api.ads.adwords.jaxws.v201806.cm.Operation,com.google.api.ads.adwords.jaxws.v201806.cm.Operand,com.google.api.ads.adwords.jaxws.v201806.cm.ApiError,MutateResult,BatchJobMutateResponse>
operations
- the operations to upload to the batch jobuploadUrl
- the BatchJob#getUploadUrl()
BatchJobException
- if the request failedpublic BatchJobUploadResponse uploadIncrementalBatchJobOperations(Iterable<? extends com.google.api.ads.adwords.jaxws.v201806.cm.Operation> operations, boolean isLastRequest, BatchJobUploadStatus batchJobUploadStatus) throws BatchJobException
BatchJobHelperInterface
BatchJobHelperInterface.uploadBatchJobOperations(Iterable, String)
instead.
If isLastRequest
, then after this method returns successfully, the job will
transition to the ACTIVE
state.
uploadIncrementalBatchJobOperations
in interface BatchJobHelperInterface<com.google.api.ads.adwords.jaxws.v201806.cm.Operation,com.google.api.ads.adwords.jaxws.v201806.cm.Operand,com.google.api.ads.adwords.jaxws.v201806.cm.ApiError,MutateResult,BatchJobMutateResponse>
operations
- the operations to upload to the batch jobisLastRequest
- if this is the last set of operations to upload for the jobbatchJobUploadStatus
- the current upload status. If this is the first upload, set the
BatchJobUploadStatus.getResumableUploadUri()
to the BatchJob#getUploadUrl()
.BatchJobException
- if the request failedpublic BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException
BatchJobHelperInterface
downloadBatchJobMutateResponse
in interface BatchJobHelperInterface<com.google.api.ads.adwords.jaxws.v201806.cm.Operation,com.google.api.ads.adwords.jaxws.v201806.cm.Operand,com.google.api.ads.adwords.jaxws.v201806.cm.ApiError,MutateResult,BatchJobMutateResponse>
downloadUrl
- the BatchJob.getDownloadUrl()
BatchJobException
public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl, int startIndex, int numberResults) throws BatchJobException
BatchJobHelperInterface
NOTE: This is only available on Axis implementations of this interface. The JAX-WS implementations will throw an UnsupportedOperationException.
downloadBatchJobMutateResponse
in interface BatchJobHelperInterface<com.google.api.ads.adwords.jaxws.v201806.cm.Operation,com.google.api.ads.adwords.jaxws.v201806.cm.Operand,com.google.api.ads.adwords.jaxws.v201806.cm.ApiError,MutateResult,BatchJobMutateResponse>
downloadUrl
- the BatchJob.getDownloadUrl()
startIndex
- zero-based index of the first result to returnnumberResults
- maximum number of results to returnBatchJobException
- if unable to download the results.Copyright © 2018. All Rights Reserved.