use of com.google.api.ads.admanager.axis.v202205.CreativePushOptions in project googleads-java-lib by googleads.
the class PushCreativeToDevices method runExample.
/**
* Runs the example.
*
* @param adManagerServices the services factory.
* @param session the session.
* @param lineItemId the ID of the line item to push to a device.
* @param creativeId the ID of the creative
* to push to a device.
* @param linkedDeviceId the ID of the linked device to push the LICA to.
* @throws ApiException if the API request failed with one or more service errors.
* @throws RemoteException if the API request failed due to other errors.
*/
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long lineItemId, long creativeId, long linkedDeviceId) throws RemoteException {
// Get the LineItemCreativeAssociationService.
LineItemCreativeAssociationServiceInterface licaService = adManagerServices.get(session, LineItemCreativeAssociationServiceInterface.class);
// Create a statement to select a single linked device.
// Linked devices can be read from the linked_device PQL table.
StatementBuilder statementBuilder = new StatementBuilder().where("WHERE id = :linkedDeviceId").withBindVariableValue("linkedDeviceId", linkedDeviceId);
CreativePushOptions options = new CreativePushOptions();
options.setLineItemId(lineItemId);
options.setCreativeId(creativeId);
UpdateResult updateResult = licaService.pushCreativeToDevices(statementBuilder.toStatement(), options);
System.out.printf("Pushed creative to %d devices%n", updateResult.getNumChanges());
}
use of com.google.api.ads.admanager.axis.v202205.CreativePushOptions in project googleads-java-lib by googleads.
the class PushCreativeToDevices method runExample.
/**
* Runs the example.
*
* @param adManagerServices the services factory.
* @param session the session.
* @param lineItemId the ID of the line item to push to a device.
* @param creativeId the ID of the creative
* to push to a device.
* @param linkedDeviceId the ID of the linked device to push the LICA to.
* @throws ApiException if the API request failed with one or more service errors.
* @throws RemoteException if the API request failed due to other errors.
*/
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long lineItemId, long creativeId, long linkedDeviceId) throws RemoteException {
// Get the LineItemCreativeAssociationService.
LineItemCreativeAssociationServiceInterface licaService = adManagerServices.get(session, LineItemCreativeAssociationServiceInterface.class);
// Create a statement to select a single linked device.
// Linked devices can be read from the linked_device PQL table.
StatementBuilder statementBuilder = new StatementBuilder().where("WHERE id = :linkedDeviceId").withBindVariableValue("linkedDeviceId", linkedDeviceId);
CreativePushOptions options = new CreativePushOptions();
options.setLineItemId(lineItemId);
options.setCreativeId(creativeId);
UpdateResult updateResult = licaService.pushCreativeToDevices(statementBuilder.toStatement(), options);
System.out.printf("Pushed creative to %d devices%n", updateResult.getNumChanges());
}
use of com.google.api.ads.admanager.axis.v202205.CreativePushOptions in project googleads-java-lib by googleads.
the class PushCreativeToDevices method runExample.
/**
* Runs the example.
*
* @param adManagerServices the services factory.
* @param session the session.
* @param lineItemId the ID of the line item to push to a device.
* @param creativeId the ID of the creative
* to push to a device.
* @param linkedDeviceId the ID of the linked device to push the LICA to.
* @throws ApiException if the API request failed with one or more service errors.
* @throws RemoteException if the API request failed due to other errors.
*/
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long lineItemId, long creativeId, long linkedDeviceId) throws RemoteException {
// Get the LineItemCreativeAssociationService.
LineItemCreativeAssociationServiceInterface licaService = adManagerServices.get(session, LineItemCreativeAssociationServiceInterface.class);
// Create a statement to select a single linked device.
// Linked devices can be read from the linked_device PQL table.
StatementBuilder statementBuilder = new StatementBuilder().where("WHERE id = :linkedDeviceId").withBindVariableValue("linkedDeviceId", linkedDeviceId);
CreativePushOptions options = new CreativePushOptions();
options.setLineItemId(lineItemId);
options.setCreativeId(creativeId);
UpdateResult updateResult = licaService.pushCreativeToDevices(statementBuilder.toStatement(), options);
System.out.printf("Pushed creative to %d devices%n", updateResult.getNumChanges());
}
use of com.google.api.ads.admanager.axis.v202205.CreativePushOptions in project googleads-java-lib by googleads.
the class PushCreativeToDevices method runExample.
/**
* Runs the example.
*
* @param adManagerServices the services factory.
* @param session the session.
* @param lineItemId the ID of the line item to push to a device.
* @param creativeId the ID of the creative
* to push to a device.
* @param linkedDeviceId the ID of the linked device to push the LICA to.
* @throws ApiException if the API request failed with one or more service errors.
* @throws RemoteException if the API request failed due to other errors.
*/
public static void runExample(AdManagerServices adManagerServices, AdManagerSession session, long lineItemId, long creativeId, long linkedDeviceId) throws RemoteException {
// Get the LineItemCreativeAssociationService.
LineItemCreativeAssociationServiceInterface licaService = adManagerServices.get(session, LineItemCreativeAssociationServiceInterface.class);
// Create a statement to select a single linked device.
// Linked devices can be read from the linked_device PQL table.
StatementBuilder statementBuilder = new StatementBuilder().where("WHERE id = :linkedDeviceId").withBindVariableValue("linkedDeviceId", linkedDeviceId);
CreativePushOptions options = new CreativePushOptions();
options.setLineItemId(lineItemId);
options.setCreativeId(creativeId);
UpdateResult updateResult = licaService.pushCreativeToDevices(statementBuilder.toStatement(), options);
System.out.printf("Pushed creative to %d devices%n", updateResult.getNumChanges());
}
Aggregations