private static final String CREATIVE_WRAPPER_ID = "INSERT_CREATIVE_WRAPPER_ID_HERE";
public static void runExample(DfpServices dfpServices, DfpSession session, long creativeWrapperId)
throws Exception {
// Get the CreativeWrapperService.
CreativeWrapperServiceInterface creativeWrapperService =
dfpServices.get(session, CreativeWrapperServiceInterface.class);
// Get the creative wrapper.
CreativeWrapper creativeWrapper = creativeWrapperService.getCreativeWrapper(creativeWrapperId);
// Update the creative wrapper ordering.
creativeWrapper.setOrdering(CreativeWrapperOrdering.OUTER);
// Update the creative wrapper on the server.
CreativeWrapper[] creativeWrappers =
creativeWrapperService.updateCreativeWrappers(new CreativeWrapper[] {creativeWrapper});
for (CreativeWrapper updatedCreativeWrapper : creativeWrappers) {
System.out.printf(
"Creative wrapper with ID \"%d\" and wrapping order \"%s\" was updated.\n",
updatedCreativeWrapper.getId(), updatedCreativeWrapper.getOrdering());