code: public static void runExample(
        AdManagerServices adManagerServices, AdManagerSession session, long productPackageId)
        throws RemoteException {
      // Get the ProductPackageService.
      ProductPackageServiceInterface productPackageService =
          adManagerServices.get(session, ProductPackageServiceInterface.class);
  
      // Create a statement to select a single product package.
      StatementBuilder statementBuilder = new StatementBuilder()
          .where("id = :id")
          .orderBy("id ASC")
          .limit(1)
          .withBindVariableValue("id", productPackageId);
      
      // Get the product package.
      ProductPackagePage page =
          productPackageService.getProductPackagesByStatement(
              statementBuilder.toStatement());
  
      ProductPackage productPackage = Iterables.getOnlyElement(
          Arrays.asList(page.getResults()));
  
      System.out.printf("Product package with ID %d will be activated.%n",
          productPackage.getId());
      
      // Remove limit and offset from statement.
      statementBuilder.removeLimitAndOffset();
  
      // Create action to activate product packages.
      com.google.api.ads.admanager.axis.v201808.ActivateProductPackages action =
          new com.google.api.ads.admanager.axis.v201808.ActivateProductPackages();
  
      // Perform action.
      UpdateResult result =
          productPackageService.performProductPackageAction(
              action, statementBuilder.toStatement());
  
      if (result != null && result.getNumChanges() > 0) {
        System.out.printf("Number of product packages activated: %d%n", result.getNumChanges());
      } else {
        System.out.println("No product packages were deactivated.");
      }
    }
docs: Runs the example.
  
  @param adManagerServices the services factory.
  @param session the session.
  @param productPackageId the ID of the product package to activate.
  @throws ApiException if the API request failed with one or more service errors.
  @throws RemoteException if the API request failed due to other errors.